Poetic is an esoteric programming language created by User:JWinslow23 in 2018. It is a derivative of brainfuck that encodes instructions into the lengths of words. Programs generally look like abstract poetry, and upon execution, they are turned into a list of numbers denoting the lengths of the words, and then executed as instructions.
The sole form of data storage in Poetic is the unsigned byte (i.e. an integer in the range 0-255). Poetic has a "tape" of 30,000 of these unsigned bytes, and a memory pointer to keep track of which value is currently being accessed.
Source code for Poetic is entered in the form of words, in any natural language. Words are considered to consist of any number of alphabetic characters and apostrophes, and any character that is not either of these is ignored and treated as a delimiter. Apostrophes do not delimit words or add to the letter count. Each word is then converted to numbers as follows:
- If a word is less than 10 letters long, it is converted to that single digit.
- If a word is exactly 10 letters long, it is converted to the digit
- If a word is more than 10 letters long, it is converted to a series of digits, representing the number as written in decimal notation (for example, a 12-letter word becomes
Each digit then turns into an instruction, and then the program is executed. The list of instructions is as follows:
||If the current byte is equal to 0, jump execution to after the matching |
||If the current byte is not equal to 0, jump execution to before the matching |
||Increment the value of the current byte by next_digit. If next_digit is 0, the value used instead is 10.|
||Decrement the value of the current byte by next_digit. If next_digit is 0, the value used instead is 10.|
||Increment the memory pointer by next_digit. If next_digit is 0, the value used instead is 10.|
||Decrement the memory pointer by next_digit. If next_digit is 0, the value used instead is 10.|
||Output the value of the current byte as an ASCII character.|
||Read a character from the input stream, and write its ASCII value to the current byte. (Note: This fails to update the current byte upon end of input.)|
|9||N/A||Set the current byte to a random value from 0 to 255.|
|0||N/A||End program execution here. This does not end program execution if it is used as an argument for |
Both the values of bytes and the memory pointer wrap around on overflow and underflow.
the proverbial "unconsciousness" i was already aware i had understood fully i saw the devil i was perfectly still involuntarily i paused there said i: my sheer consciousness of certain given circumstances i noticed it's nothing nothing nothing any man wouldn't learn a way of finding these i know not nothing common or typical and yet (somehow) very little thought will normally resolve every contradiction a foolish heart -> an eternal misfortune
This program is in the form of a haiku. Such poetic structure is encouraged, though not enforced.
stranger, i confess i have longstanding problems i'm unprepared for
whenever i drink a beverage i'm always intoxicated .egnarts yllaeR i am inebriated
This program prints every ASCII character in an infinite loop.
love is a great mystery but i couldn't really explain it
This sets the first cell of the tape to a random number (accomplished with the first word,
LIGHTNING), and then outputs it in decimal. Because this feature is not built into the language, it must be done using combinations of other instructions, making this the length of a small piece of prose.
[ LIGHTNING ] *a flash!* *a zap!* *a flash!* *a zap!* a...Fourth of July? I am still electrified. Inside, I see a burst of flames... ...a fire... I am the source. LEAVE IMMEDIATELY BEHOLD, A HUGE METEOR CRASH IMMEDIATELY LEAVE I was frightened almost traumatized Have I heard hallucinations? Unspeakable evils? I say... I think no. No, their progression and advancement isn't a threat. I say... I think I am worse. I say... I think I'm no longer light. I'm shade. Inescapable dark. I am now sinister. I think I see little, except a dark, impenetrable cloud... No...no...never... ...I am purely-intentioned... I still try... ...try fighting longer.... Too late. I am truly with my people. Mischievous, devious... ...a dark disappearing animal. Gloomy night now is EVERYWHERE.