esolang

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

Expected: cat

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.

DigitDoes
1 2[ and ]
3 4Add or subtract the next digit (0 means 10)
5 6Move right or left by the next digit
7 8Print the byte, read a byte
9A random byte
0End

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.

Expected: desserts

The Hello World prints Hello World! and a line break.

Patterns it teaches

Further

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-esolang

Source

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