esolang

aboba

Numbered variables, a stack and brainfuck's loop, made in one day.

R3D, 2021 · Turing complete: yes · ●○○ easy · esolangs.org

Tested with 3 known programs · Test method

Run it

Expected: Hello World!

The idea

R3D made aboba in one day in 2021, after brainfuck. There is no tape. There are numbered variables, %N opens one of them, and every other command works on the one that is open. Numbers are written out, so +72 adds 72 in a single step. A stack sits beside the variables for arithmetic, and [N ...] runs a block only when the open variable is N. That is how the calculator picks its operator.

The machine

CommandDoes
%NOpen variable N
+N -NAdd N to it or take N from it
( )Print it as a character or as a number
ic inRead a character or a number into it
{ ... }Loop while it is not 0
[N ... ]Run the inside only when it is N
?< ?>When it is 0, jump back or forward to the nearest wall, |
sp sgPush it; pop into it
sd swDuplicate the top; swap the top two
s+ s- s* s/Pop two and push the top plus, minus, times or divided by the other
~End the program
"A comment to the end of the line

Every variable starts at 0, and every other character does nothing. Numbers have no size limit, and in reads a whole line and takes the number on it.

Example

Hello World walks one variable from letter to letter.

Hello World walks one variable from letter to letter.

The calculator reads two numbers and an operator, each on its own line. sw puts the first number on top, so - takes the second from the first. An operator it does not know prints Invalid!.

Expected: 42

The Fibonacci program keeps the last two numbers in variables 1 and 2, adds them on the stack and stops with [17711 ~]. Variable 4 holds 10, the line feed.

Expected: 0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181 6765 10946 17711

Patterns it teaches

Further

Also in Turing tarpits

Write your own in Run Convert a program from aboba

Implementation

JavaScript interpreter, source and command line

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

Command line

shib run aboba -e '%1 +72 ( +29 ( +7 ( ( +3 ( -79 ( +55 ( +24 ( +3 ( -6 ( -8 ( -67 ('
shib manual aboba

Source

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

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

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