esolang

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

Expected: cat

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.

PrimeDoesPrimeDoes
2, 3Select the next, previous queue19, 23Move the front to the next, previous queue
5Print the front byte29Drop the front
7Read a byte into the front31Enqueue y mod 256
11, 13Subtract the front from y, add it37Skip the next prime if the front is 0
17Add y mod 256 to the front41Swap x and y
43End

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.

Expected: 0
Expected: Hello, World!

Patterns it teaches

Further

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 eine

Source

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