Alphabet Stew
Brainfuck with a stack beside the tape, spelled with the 26 lower case letters and nothing else.
DMC, 2018 · Turing complete: yes · ●●○ moderate · esolangs.org
Tested with 3 known programs · Test method
Run it
The idea
DMC made Alphabet Stew in 2018. It keeps brainfuck's tape of cells and adds a stack, and it has exactly 26 commands, one for each letter from a to z. The specification says no effort was made to give a command a fitting letter, so the loop is t ... i and b prints. Digits are not used, and every character that is not a lower case letter is ignored.
The machine
Cells hold 0 to 255 and start at 0. Commands on one cell leave the stack alone, and commands on two values pop them both and push the result.
| Letter | Does |
|---|---|
s d | Move right; move left, where left of cell 0 is an error |
e u | Add 1; subtract 1 |
m a | Shift the cell left; shift it right |
y | Flip every bit of the cell |
t ... i | Loop while the cell is not 0 |
o l | Push the cell; pop into the cell |
c | Copy the top of the stack into the cell |
w j | Swap the top two; empty the stack |
g x k p q | Add, subtract, xor, and, or |
f h | Jump back or forward by the cell's value |
b v | Print the cell as a character; as three digits |
z r | Read a character; read a decimal number |
n | Halt |
Example
The Hello, World! program builds the characters with e and the shift m, pushes them in reverse, and ends…
The Hello, World! program builds the characters with e and the shift m, pushes them in reverse, and ends with a loop that prints the cell and pops the next one until it pops the 0 pushed first. Its last ! is a diagnostic the specification says need not be built; this implementation ignores it.
The Fibonacci keeps the last two values on the stack, adds them with g and counts down from 13 in cell 0. The program stops at 14 values, before the sum outgrows 8 bits. The truth machine prints 000 on 0; on 1 it prints 001 forever.
Patterns it teaches
- Stack machines: a stack next to brainfuck's tape.
- Turing tarpit: brainfuck underneath, in other letters.
Further
See also
Alphabet Stew builds on Brainfuck.
Brainfuck derivatives
Write your own in Run Convert a program from Alphabet Stew
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: alphabet-stew.
Command line
shib run alphabet-stew -e 'rtsetviiv' --input '0'shib manual alphabet-stewSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/alphabet-stew.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org