esolang

Siterip

A program is one number. It picks a brainfuck program from a list of all of them.

Hakerh400, 2020 · Turing complete: yes · ●●○ moderate · esolangs.org

Tested with 5 known programs · Test method

Run it

Expected: Siterip

The idea

Hakerh400 made Siterip in 2020. The source is a single whole number N, as large as you like. Every brainfuck program with matched brackets is put in one long list, and Siterip runs the Nth one on the real input. So every number is a program, and every brainfuck program that halts on the empty input has a number.

Read the story

The list is sorted by how long a program is plus how long it runs. Programs that never halt on the empty input are left out, which is why the list can only be built by running its candidates.

The machine

StepDoes
0The empty program
thenPrograms in rising order of length plus ticks on the empty input
same sumThe shorter program first
same length and ticksBy the first differing character, in the order <>+-,.[]

A tick is one instruction. [ and ] count as ticks too, and ] always jumps back to its [, which then counts again. The specification lists the first 1,001 programs, and this implementation builds that list exactly. Number 1 is <, number 7 is [], and number 631 is +,[], which only halts when reading past the end of the input stores 0.

Cells are bytes that wrap and the tape runs both ways without end.

Example

The cat is number 800, the program ,[.,].

The cat is number 800, the program ,[.,].

Number 37 is ,., which copies one character, and number 258 is ,+., which prints the next one.

Expected: a
Expected: b

Finding number 800 takes about 60,000 steps of trial runs. The numbers grow fast with the program, so a Hello World has a number far too large to reach.

Patterns it teaches

Further

Siterip builds on Brainfuck.

Brainfuck derivatives

Write your own in Run Convert a program from Siterip

Implementation

JavaScript interpreter, source and command line

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

Command line

shib run siterip -e '37' --input 'abc'
shib manual siterip

Source

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

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

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