esolang

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

Expected: Hello, World!

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.

LetterDoes
s dMove right; move left, where left of cell 0 is an error
e uAdd 1; subtract 1
m aShift the cell left; shift it right
yFlip every bit of the cell
t ... iLoop while the cell is not 0
o lPush the cell; pop into the cell
cCopy the top of the stack into the cell
w jSwap the top two; empty the stack
g x k p qAdd, subtract, xor, and, or
f hJump back or forward by the cell's value
b vPrint the cell as a character; as three digits
z rRead a character; read a decimal number
nHalt

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.

Expected: 000 001 001 002 003 005 008 013 021 034 055 089 144 233
Expected: 000

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

Further

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

Source

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