esolang

GORBITSA

Eight letters, one byte of register and 256 bytes of memory. The name is the instruction set.

David Barr, 2020 · Turing complete: with unbounded memory · ●○○ easy · esolangs.org

Tested with 8 known programs · Test method

Run it

Expected: Hello World

The idea

David Barr, known as javidx9, made GORBITSA in 2020 as a programming challenge for the One Lone Coder community. It is jokingly named after Gorbit, one of the community's moderators, and the name spells the eight instructions. When the limits of the base language showed, each letter got a lower case twin that goes through memory, which gave it pointers, computed jumps and XOR.

Read the story

Everything is a byte. The register X and the 256 memory cells hold 0 to 255 and wrap around, and a program has at most 256 slots. So the specification calls it a finite state machine, not Turing complete.

The machine

LetterDoesLower case
G NX = mem[N]X = mem[mem[N]]
O Nmem[N] = Xmem[mem[N]] = X
RRead a character into Xr N reads into mem[N]
B NIf X is 0, jump to slot Nto slot mem[N]
I NX += Nmem[N] += X
TPrint X as a charactert N prints mem[N]
S NX = NX = X xor mem[N]
A NX += mem[N]X += mem[mem[N]]

Instructions are split by spaces and numbered from 0. The run ends after the last one. This implementation runs GORBIT-ROM, where the program lives outside memory. GORBIT-RAM, where the program sits in memory two bytes an instruction, is not built.

The specification lets input and output be characters or numbers. In this implementation both are characters, and the end of the input reads as 0.

Example

The second program is the short subtraction.
Expected: B
Expected: F

The second program is the short subtraction. It reads c into memory and ! into X, flips X with XOR 255 and adds 1, which makes it -33, and adds c. 99 - 33 is 66, a B.

The third is the number comparison. It counts both values down together and prints T if the first reaches 0 first or at the same time, F otherwise. Its T path also prints the 0 left in X, so 35 prints T and a zero byte. The truth machines read and print numbers, so they need the other I/O choice.

Patterns it teaches

  • Turing tarpit: a whole machine in eight letters, and still not enough memory to be Turing complete.

Further

Also in Turing tarpits

Write your own in Run Convert a program from GORBITSA

Implementation

JavaScript interpreter, source and command line

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

Command line

shib run gorbitsa -e 'R T' --input 'G'
shib manual gorbitsa

Source

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

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

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