esolang

this

Nothing but digits. A jump even says how many digits its own numbers take.

Alluseri, 2021 · Turing complete: yes · ●●○ moderate · esolangs.org

Tested with 7 known programs · Test method

Run it

Expected: Hello, world!

The idea

Alluseri made this in 2021, after Celsee and its idea of using only numbers. It is also called Fareen, and its name is written in lower case, like the this keyword. Every command is one digit, so a program is one long number.

Read the story

There are no brackets for loops. A jump names a place in the program by its index, the count of characters from the start, and it first says how many digits that index has. 721420 reads as 7, then the lengths 2 and 1, then 42, then 0. It jumps back to index 0 while the cell is not 42.

The machine

DigitDoes
0Nothing
1 2Move to the next or the previous cell
3 4Add or take away 1
5NEJump to index E, which has N digits
6NBEIJump to I when the cell equals E
7NBEIJump to I when the cell is not E
8Print the cell as a character
9Read a number into the cell

There are 1024 cells of 32 bits, all 0 at the start. A jump past the end of the program halts it, which is how the comparator program returns. The specification says brainfuck compiles into this, so it is Turing complete.

Example

The shortest Hello world.

The shortest Hello world. 3721720 counts the cell up to 72 in a loop on the 3 at index 0, and 8 prints H. The first Hello world uses only 1, 3 and 8 and has 1,187 digits; this one has 96.

The while loop with an 8 after it counts to 42 and prints the character 42. 9 reads a number.

Expected: *
Expected: A

Patterns it teaches

Further

Zero-dimensional languages

Cell-based

Write your own in Run Convert a program from this

Implementation

JavaScript interpreter, source and command line

A JavaScript interpreter, used in the browser and on the command line. Id: this.

Command line

shib run this -e '3721420'
shib manual this

Source

Module
langs/wiki/ports.js
Interpreter
langs/wiki/this.js

Docs: Kernel instructions · The .shib format · Command line · Adding a language

Source esolangs.org (CC0) · Edit on esolangs.org