esolang

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

Expected: Hi

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

CommandDoes
> < + -Move the pointer, change the cell
. , NPrint the cell as a character, read one, print it as a number
L72 A PSet 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_cRun command a cell times, run a and b, run a forever, run c n times
@v_a_bRun command a when the cell is v, else b
Ea Dc_a pipea¬cDelete command a, insert c at place a, put c in place a
#x =x_v §x ¢xMake 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.
Expected: 13
Expected: 0

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

Further

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 lack

Source

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