Lack
Brainfuck's cells, with commands that run, delete and rewrite other commands by their place.
2025 · Turing complete: unknown · ●●○ moderate · esolangs.org
Tested with 5 known programs · Test method
Run it
The idea
Lack is German for varnish. It starts from brainfuck's tape of cells and adds about thirty commands. Many of them point at another command of the program by its place, counted from 1. $3 runs the third command as many times as the cell says, E5 deletes the fifth, D+_3 puts a new + in third place and @48_5_0 runs the fifth command when the cell holds 48. There are no comments, and a word that is no command does nothing, so it can serve as a label for £, which goes on from the first command that matches it.
Read the story
The specification has two versions, both built in Snap!. Version 2 adds a remember value with L, A and P. Version 1 keeps the same value in a variable called remember. Both versions work.
The machine
| Command | Does |
|---|---|
> < + - | Move the pointer, change the cell |
. , N | Print the cell as a character, read one, print it as a number |
L72 A P | Set the remember value, copy the cell into it, copy it into the cell |
O+ | Set the remember value to itself plus the cell, also - * / ^ % |
$a !a_b Fa ~n_c | Run command a cell times, run a and b, run a forever, run c n times |
@v_a_b | Run command a when the cell is v, else b |
Ea Dc_a pipea¬c | Delete command a, insert c at place a, put c in place a |
#x =x_v §x ¢x | Make a variable, set it, copy it into the cell, copy the cell into it |
£x && | Go on after the first command x; stop |
The random ^ and the ASCII U are left out. Cells are numbers without bounds, and , reads 0 at the end of the input.
Example
The second is the example for O.
The second is the example for O. The third is a truth machine. On 0 the second command runs the fifth, £zero, which goes on after the label zero, prints 0 and stops. On 1 the third command runs £one, and the program prints 1 forever.
Patterns it teaches
- Self-modifying code: commands delete, insert and replace commands.
Further
See also
Cell-based
Write your own in Run Convert a program from Lack
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: lack.
Command line
shib run lack -e ', .' --input 'a'shib manual lackSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/lack.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org