Poetic
Brainfuck written as a poem, where only the length of each word counts.
JWinslow23, 2018 · Turing complete: yes · ●●○ moderate · esolangs.org
Tested with 3 known programs · Test method
Run it
The idea
JWinslow23 made Poetic in 2018. A program is any text in any language. Each word becomes the digit of its length, and the digits are the program. So the Hello World is a free verse poem about the devil, and the cat is a haiku.
Read the story
Poetic is a little stronger than brainfuck. +, -, > and < take the next digit as a count, so one pair of words can add up to 10. There is a random byte, and a way to end the program early.
The machine
A word is a run of letters and apostrophes, and apostrophes do not count. A word of 1 to 9 letters is that digit, 10 letters is 0, and a longer word gives the digits of its length, so 12 letters is 1 then 2.
| Digit | Does |
|---|---|
| 1 2 | [ and ] |
| 3 4 | Add or subtract the next digit (0 means 10) |
| 5 6 | Move right or left by the next digit |
| 7 8 | Print the byte, read a byte |
| 9 | A random byte |
| 0 | End |
The tape has 30,000 bytes. Bytes and the pointer both wrap. At the end of input 8 leaves the byte as it was.
Example
The cat haiku.
The cat haiku. stranger, i confess is 8 1 7, which reads, loops and prints. The next lines read again and close the loop.
Reverse input reads everything, then prints it backwards. .egnarts yllaeR is a 7 and an 8.
The Hello World prints Hello World! and a line break.
Patterns it teaches
- Camouflage: code that reads as a poem.
- Encoding tricks: only word lengths carry meaning.
- Turing tarpit: brainfuck underneath.
Further
- esolangs.org/wiki/Poetic_(esolang)
- PoeticFuck, the same machine written in symbols
See also
Poetic builds on Brainfuck.
Pseudonatural
Brainfuck derivatives
Write your own in Run Convert a program from Poetic
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: poetic-esolang.
Command line
shib run poetic-esolang -e 'stranger, i confess
i have longstanding problems
i'\''m unprepared for' --input 'abc'shib manual poetic-esolangSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/poetic-esolang.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org