Aarkinitio
Every cell holds a piece of text, and the only way to change it is to name what it says now.
RainbowDash, 2024 · Turing complete: yes · ●●○ moderate · esolangs.org
Tested with 2 known programs · Test method
Run it
The idea
RainbowDash made Aarkinitio in 2024. Memory is a row of 3,000 cells that start as 0, and a pointer that is set with poke but never stepped. eqr replaces a cell's text only when it equals a given word, so a program counts by listing every step, Sum:0 to Sum:1, Sum:1 to Sum:2 and so on. bne jumps when the cell differs from a word, and ret goes back to the last bne.
Read the story
The specification has its own interpreter in JavaScript, and this implementation follows it word by word. It cuts the program at spaces, line feeds and slashes, and it takes arguments as the next words, whatever they are.
The machine
| Instruction | Does |
|---|---|
poke N | Point at cell N |
eqr WORD TEXT | If the cell equals WORD, replace it with TEXT |
bne TEXT LABEL | Jump to :LABEL if the cell is not TEXT |
ret | Go back to the last bne that ran |
peek | Print the cell and a line feed |
inp | Read a line into the cell |
TEXT runs to the next instruction or label. Comparisons are loose, as in JavaScript, so the starting 0 also equals 00. A jump to a label that is not there starts the program over.
Example
The cat loops on bne goto loop, which jumps whenever the cell is not goto.
The cat loops on bne goto loop, which jumps whenever the cell is not goto. So it echoes line after line, and the only way out is to type goto.
Counting is a ladder of eqr lines, written top down so that one step does not set off the next. The add1 part of the NIM game in the specification is cut to its last two steps. ret comes back to the bne that called it and carries on after it.
Patterns it teaches
- String rewriting: a cell changes only by a rule that matches its whole text.
Further
See also
String-rewriting paradigm
Cell-based
Write your own in Run Convert a program from Aarkinitio
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: aarkinitio.
Command line
shib run aarkinitio -e 'poke 0
eqr 0 Hello world!
peek'shib manual aarkinitioSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/aarkinitio.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org