EINE
NULL in one dimension. The primes are written out one by one instead of multiplied into one number.
None1, 2024 · Turing complete: unknown · ●●● hard · esolangs.org
Tested with 4 known programs · Test method
Run it
The idea
None1 made EINE in 2024 as a partner to NULL. EINE is German for one, as NULL is for zero. A NULL program is one number, and its instructions are its prime factors, smallest first. An EINE program lists the instructions as numbers split by spaces, in the order they run.
Read the story
Each number stands for the instruction of its place among the primes, counted mod 14, so 47 acts as 2. The specification gives a converter to NULL, and that converter is what EINE means. It gives each instruction the smallest prime of its kind at or after the one before it, and the product is the NULL program. So the Hello World written with small primes only, 3 3 3 17 31 17 5 ..., turns into the same 170 digit number as NULL's own.
That matters because NULL keeps a second number, y, and every prime that runs is multiplied into it. Printing uses y mod 256, so the real primes count, not only their kind.
The machine
Three queues of bytes, one selected, and the two numbers x and y. x starts as the program and y as 1. Each step moves the smallest prime of x into y and runs it.
| Prime | Does | Prime | Does |
|---|---|---|---|
| 2, 3 | Select the next, previous queue | 19, 23 | Move the front to the next, previous queue |
| 5 | Print the front byte | 29 | Drop the front |
| 7 | Read a byte into the front | 31 | Enqueue y mod 256 |
| 11, 13 | Subtract the front from y, add it | 37 | Skip the next prime if the front is 0 |
| 17 | Add y mod 256 to the front | 41 | Swap x and y |
| 43 | End |
The specification leaves the end of the input open. As in NULL, reading past it ends the program, and so does x reaching 1.
Example
The cat reads a byte, prints it and swaps x and y.
The cat reads a byte, prints it and swaps x and y. By then y is 7 × 59 × 103, the whole program, so it starts over.
Patterns it teaches
- Encoding tricks: the same program as a list or as one product.
Further
See also
Also in Turing tarpits
Write your own in Run Convert a program from EINE
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: eine.
Command line
shib run eine -e '7 59 103' --input 'cat'shib manual eineSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/eine.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org