Phena
Every program is one sentence in a language nobody speaks. Neho phene.
2023 · Turing complete: no · ●○○ easy · esolangs.org
Tested with 3 known programs · Test method
Run it
The idea
Phena is from 2023. A program is a single sentence that should read like English, or at least like a language. It starts with a capital and ends with a period, and its words are glued together from syllables.
Read the story
Twenty syllables that start with a nasal are the variables, from na and nae to mu and my. A command is another syllable stuck to a variable, so phene prints the variable ne and jeina counts na up. There is one loop, and it always looks at nu.
The machine
| Word | Does |
|---|---|
phe__ | Print the variable, as a character or as its text |
i__ | Read one character into it |
jei__ sha__ | Count it up or down, wrapping between 0 and 255 |
__ho | Put the text Hello World in it |
pa ... tho | Loop while nu is not 0 |
te | End the program |
Every variable starts at 0 and holds a number from 0 to 255 or the text Hello World. Counting a variable that holds text starts it again from 0. Only the first word has a capital, so the same command is Jeina at the start of a sentence and jeina anywhere else.
Example
Neho puts Hello World in ne and phene prints it.
Neho puts Hello World in ne and phene prints it.
The cat reads into nu and loops until it reads the null character. Reading past the end of the input gives 0, so it stops there too.
A counted loop. nu goes up to 3 and the loop prints ne and counts nu down until it is 0.
The truth machine takes 48 from the input with 48 shanu and counts na up to 49, the character 1, with 49 jeina. On a 1 the loop prints na forever. On a 0 it skips the loop, and one shana turns the 1 into a 0.
Patterns it teaches
- Camouflage: a program dressed up as a sentence.
Further
See also
Also in Camouflage
Write your own in Run Convert a program from Phena
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: phena.
Command line
shib run phena -e 'Neho phene.'shib manual phenaSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/phena.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org