EsoProg
Overview
My sense of humor has led to my enjoyment and facination with esoteric programming languages. To explore this interest, I've started building a IDE of sorts to write, interpret, visualise and compile various esoteric languages. As of right now, only Piet has been implemented but I also intend on adding support for:
- Brainf*ck
- COW
- Auld Lang
You can take a look at the project in my Github
Piet
Piet is a stack based programming language where you use groups of pixels in an image and the transition between these groups as instructions instead of keywords. The colour pallete is ordered consists of Light, Normal and Dark shades of Red, Yellow, Green, Cyan, Blue and Magenta:
| Light red | Light yellow | Light green | Light cyan | Light blue | Light magenta |
| Red | Yellow | Green | Cyan | Blue | Magenta |
| Dark red | Dark yellow | Dark green | Dark cyan | Dark blue | Dark magenta |
The change in hue and brightness of these colours is used to index into a table of commands:
| Lightness change | Hue change | |||||
|---|---|---|---|---|---|---|
| Equal Hue | 1 Hue | 2 Hue | 3 Hue | 4 Hue | 5 Hue | |
| Equal Shade | N/A | Add | Divide | Greater Than | Duplicate | Input Char |
| 1 Shade Darker | Push | Subtract | Modulo | Pointer | Roll | Output Int |
| 2 Shades Darker | Pop | Multiply | Not | Switch | Input Int | Output Char |
Brainf*ck
Brainf*ck is one of the most famous esoteric programming language, it's main focus is on being difficult to read and understand; thus the name. Brainf*ck assumes an array of (normally) 30,000 8-bit values (initialized to 0) which wraps around at either end. The program starts with its focus on the first item in this array. This is very similar to a Turing Machine which operates on an infinite tape of 1s and 0s. The instructions are:
| Instruction | Action |
|---|---|
| > | Move focus to the next cell |
| < | Move focus to the previous cell |
| + | Increment the value in the current cell |
| - | decrement the value in the current cell |
| . | Output the value in current cell as a char |
| , | Input char into the current cell |
| [ | If the current cell's value is 0, jump execute to after the matching ']', otherwise continue execution |
| ] | If the current cell's value is 0, jump back to immediately after the matching '[', otherwise continue execution |
COW
COW is a based on Brainf*ck with a couple extra instructions. It's easily one of the silliest languages I've come accross with every command being a mix up of order and captilisation of the word moo.
| Instruction Value | Instruction | Action |
|---|---|---|
| 0 | moo | Search the program text backwards (skipping the previous instruction) and jump to the matching 'MOO' command |
| 1 | mOo | Move focus to the next cell |
| 2 | moO | Move focus to the previous cell |
| 3 | mOO | Execute the value in the current cell as a command (if out of range then exit program) |
| 4 | moo | If the current cell's value is 0, input char into the current cell, otherwise output the current cell as a char |
| 5 | MOo | Decrement the value in the current cell |
| 6 | MoO | Increment the value in the current cell |
| 7 | MOO | If the current cell's value is 0, search for the matching 'moo' command (ignoring the next command) and resume execution immediately after it, otherwise continue execution |
| 8 | OOO | Set the current cell to 0 |
| 9 | MMM | If register is empty, copy the value in the current cell into the register, otherwise set the current cell to the value of the register and clear it |
| 10 | OOM | Output the value of the current cell as an Integer |
| 11 | oom | Input Integer into the current cell |
Auld Lang
Auld Lang is another Brainf*ck inspired language, this time based on the Scots song Auld Lang Syne by Robert Burns Instructions are formatted <Command>[<Terminator>?]\n. Terminators are optional secondary effects any command can be given. Arguments are provided as the number of characters (not including the first space; the terminator or newline) following a command.
|
|
|---|
Source
My source for all the information about these languages has been EsoLang