esolang

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

Expected: Hello, World!

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

StatementDoes
psText pvx pa10Print a text, a variable, or the character with that code
ixRead a line into x
sxVSet x to V
+xV -xV *xV /xV ^xVAdd, subtract, multiply, divide or raise x by V
_xVJoin V onto the end of x
l gl ?xlA label; go to it; go to it if x is not 0
gsl rCall the label as a subroutine; return
d rx r0Start the data; read the next item into x; go back to the first
cText eA 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.

Expected: Number120

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.

Expected: How many0 1 1 2 3 5 8 13 21 34

Further

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 dbondb

Source

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