POETIC

Poetry in Execution


On this page:

Poetic is an esoteric programming language (or esolang) based on one of the most classic esolangs, brainf***. The main form of data storage in Poetic is the unsigned byte, which can be used to store a number in the range 0–255, an ASCII character, or whatever else you can conceive of using it for. Poetic has a "tape" of 30,000 of these values, and a memory pointer to keep track of which one of those values is currently being accessed.

The beauty of Poetic, and what sets it apart from most other programming languages, is that there are multiple ways to write a program. Poetic programs can be written in natural language, as a way to either self-describe them, obfuscate them, or to simply have fun with their design. The goal of the Poetic programming language is that someone could walk into a slam poetry session, recite a Poetic program, and have nobody know the difference.

Source Code

Source code for Poetic is entered in the form of words, in any natural language. There are exactly 10 instructions in Poetic, each represented by a numeric digit, and each word is converted to instructions as follows:

While it is possible to program using words that aren't "real", but are considered words by this system, this is not recommended. It misses the whole point of the language in the first place. (If you are able to use this device to great poetic effect, however, feel free!)

Here are some special cases that arise as a consequence of these rules:

WordInstructions
easy4
shouldn't8
vocabulary0
unintelligible1, 4
word-for-word4, 3, 4
4th place2, 5
good4you4, 3
fun & games3, 5

Instruction Set

Poetic has 10 instructions, each represented by a numeric digit. They are as follows:

ValueOpcodeDescription
1IF If the current byte is equal to 0, jump execution to after the matching EIF.
2EIF If the current byte is not equal to 0, jump execution to before the matching IF.
3INC Increment the value of the current byte by next_digit. If next_digit is 0, the value used instead is 10.
4DEC Decrement the value of the current byte by next_digit. If next_digit is 0, the value used instead is 10.
5FWD Increment the memory pointer by next_digit. If next_digit is 0, the value used instead is 10.
6BAK Decrement the memory pointer by next_digit. If next_digit is 0, the value used instead is 10.
7OUT Output the value of the current byte as an ASCII character.
8IN Read a character from the input stream, and write its ASCII value to the current byte.
9RND Set the current byte to a random value from 0 to 255.
0END End program execution here. This does not end program execution if it is used as an argument for INC, DEC, FWD, or BAK.

Note that the words for the opcodes are not the instructions themselves, but they are handy ways to refer to the instructions in Poetic pseudocode. Writing BAK 4 in your source code will not result in a BAK 4 being executed; writing Poetic code (for example) would have this effect.

Clarifications

These definitions still leave a bit of room for interpretation for many situations that could arise. Here is my attempt at clarifying the correct behavior in these situations.