EsoBASIC
BASIC cut down to ten commands. Variables count up and down, and IF only asks whether one is 0.
Yes, 2022 · Turing complete: yes · ●●○ moderate · esolangs.org
Tested with 4 known programs · Test method
Run it
The idea
EsoBASIC was made in 2022. It looks like an old BASIC with line numbers, but arithmetic is gone. LET += x adds one and LET -= x takes one away, and IF x skips the next line when x is 0. That is a Minsky machine, so the language is Turing complete, and the specification links a compiler from 3-register Minsky machines to EsoBASIC. The square program squares its input with nothing but those three operations.
The machine
| Command | Does |
|---|---|
PRINT text | Print the text |
PRINTVAR x | Print x |
INPUT x | Read x |
LET x | Create x as 0 |
LET += x LET -= x | Add one, subtract one |
IF x | Skip the next line if x is 0 |
GOTO n | Go to line n, counting from 1 |
CLS END | Clear the screen, stop |
Example
The second is the truth machine.
The second is the truth machine. With 0 the IF skips the GOTO and the program prints 0. With 1 it jumps to line 7, which is END, so this copy of the truth machine stops instead of printing 1 forever.
Further
Ideas it shows
See also
Also in Turing tarpits
Write your own in Run Convert a program from EsoBASIC
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: esobasic.
Command line
shib run esobasic -e 'CLS
PRINT Hello, World
END'shib manual esobasicSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/esobasic.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org