TheLang
A brainfuck program, written as how many times you say the.
Tema5002, 2024 · Turing complete: yes · ●○○ easy · esolangs.org
Tested with 2 known programs · Test method
Run it
The idea
Tema5002 made TheLang in 2024, after brainfuck and in the line of Unary. Each of brainfuck's eight commands gets a digit from 0 to 7. The commands, read from the last to the first, make a number in base 8, and the program is the word the written that many times.
Read the story
The program --. is 3 3 4, so 433 in base 8, which is 283. Those 283 words print the byte 254, a thorn þ. Every command multiplies the length by 8. The second example, .+[.+], prints every byte from 0 to 255 and needs 240,020 words, about 960,000 characters.
The machine
| Command | Digit |
|---|---|
< | 0 |
> | 1 |
+ | 2 |
- | 3 |
. | 4 |
, | 5 |
[ | 6 |
] | 7 |
Only the word the counts. The brainfuck runs on byte cells that wrap, which the second example needs to stop, and , stores 0 at the end of the input.
Example
37 is 45 in base 8, so 37 words of the are the brainfuck ,., which echoes one character.
37 is 45 in base 8, so 37 words of the are the brainfuck ,., which echoes one character.
Patterns it teaches
- Encoding tricks: a whole program kept in one number.
- Turing completeness: every brainfuck program has its count.
Further
See also
TheLang builds on Brainfuck.
Brainfuck equivalents
Brainfuck derivatives
Write your own in Run Convert a program from TheLang
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: thelang.
Command line
shib run thelang program.txtThe program is long; save it as program.txt first.
shib manual thelangSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/thelang.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org