Dbondb
Dartmouth BASIC with every keyword cut down to a letter or two, and labels in place of line numbers.
Sideshowbob · Turing complete: unknown · ●○○ easy · esolangs.org
Tested with 2 known programs · Test method
Run it
The idea
Sideshowbob derived Dbondb from Dartmouth BASIC, the first BASIC, from 1964. The name is "DB or not DB", and the specification asks whether it puts more effort into the name than into the language. A program is one long line of statements split by semicolons. Variables are the letters a to z, and every value is text, which arithmetic reads as a number.
The machine
| Statement | Does |
|---|---|
psText pvx pa10 | Print a text, a variable, or the character with that code |
ix | Read a line into x |
sxV | Set x to V |
+xV -xV *xV /xV ^xV | Add, subtract, multiply, divide or raise x by V |
_xV | Join V onto the end of x |
l gl ?xl | A label; go to it; go to it if x is not 0 |
gsl r | Call the label as a subroutine; return |
d rx r0 | Start the data; read the next item into x; go back to the first |
cText e | A comment; end |
V is another variable when it is a single letter, and a constant otherwise. The specification never says how a label is named. Every example with a loop writes its label as l; and jumps to it with ?cl; or ?nl;, so a label's name is its whole statement, and lloop; is reached with glloop;. Results are written back as text, whole numbers without a point.
Example
The factorial reads n, counts c down from one less than n, and multiplies n by every value of c until c is 0.
The factorial reads n, counts c down from one less than n, and multiplies n by every value of c until c is 0.
The Fibonacci program keeps two numbers in a and b and prints a as many times as it is asked to. The prompt is printed without a line break, and input prints nothing.
Further
See also
Also in Jokes
Write your own in Run Convert a program from Dbondb
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: dbondb.
Command line
shib run dbondb -e 'psHello, World!;pa10;e;'shib manual dbondbSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/dbondb.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org