Celum
A tape of bits with no pointer. To move anything, run a cellular automaton over the whole tape.
Zzo38, 2006 · Turing complete: unknown · ●●● hard · esolangs.org
Tested with 4 known programs · Test method
Run it
The idea
Zzo38 made Celum in 2006. Memory is a tape of bits, unbounded both ways and all 0. There is no pointer and no way to touch one cell. A pair of hex digits runs that elementary cellular automaton rule on every cell at once. Rule F0 gives each cell the value of its left neighbour, so the whole tape slides one cell right. AA slides it left, 00 clears it and FF fills it with 1.
Read the story
Input, output and every decision use the one bit in the middle of the tape. Each line starts with 0: or 1:. The commands { and } flip the middle bit and jump to the nearest line above or below whose first digit is the new value.
The machine
| Command | Does |
|---|---|
hh | Run elementary rule hh (two hex digits, Wolfram code) on the whole tape |
{ } | Flip the middle bit, then go to the nearest line above or below that starts with its new value |
i | Read the next input bit into the middle, lowest bit of each byte first |
o | Write the middle bit; every eight bits print one byte |
? | Skip the rest of the line when the flag is 0 |
!label | Flip the flag and go to the next line with that label, wrapping around to the top |
A line is 0:label:commands or 1:label:commands, and C: starts a comment. The flag is one more bit, apart from the tape. The run starts at the first line and ends after the last, or at a ! whose label is nowhere.
Example
The one-time cat from the specification reads eight bits and writes each one straight back.
The one-time cat from the specification reads eight bits and writes each one straight back.
The Hello World has 56 lines. Its first five print the H, which is 0 0 0 1 0 0 1 0 lowest bit first. Each line writes a run of equal bits, then } flips the middle bit and drops to the next line that starts with the new value.
A rule can also set the middle bit by itself. FF makes every cell 1 and 00 makes every cell 0.
The truth machine from the specification, without its comment lines. On 1 it writes the input byte while F0 moves it into the tape, slides it back with eight AA, and prints it again forever. On 0 it jumps to printZero and prints 0 once.
Past the end of the input i reads 0 bits, and bits after the last full byte are not printed. The specification also gives a translation from Boolfuck. Its [ enters the loop with the middle bit flipped, so a translated loop does not run as Boolfuck would.
Patterns it teaches
- Cellular automata: every change to memory is one rule applied to all cells at once.
- Turing tarpit: six kinds of command and one bit outside the tape.
Further
See also
Also in Turing tarpits
Write your own in Run Convert a program from Celum
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: celum.
Command line
shib run celum -e '0::ioioioioioioioio' --input 'A'shib manual celumSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/celum.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org