Language

BASIC

First appeared
1964
Paradigm
Imperative, unstructured
Toolchain
Bywater BASIC 2.20
Container image
debian:trixie-20261027-slim + bwbasic 2.20pl2-14

BASIC (Beginner’s All-purpose Symbolic Instruction Code) was created at Dartmouth College in 1964 by John Kemeny and Thomas Kurtz, so that students who weren’t scientists could write programs. A version of it came built into most home computers of the late 1970s and 1980s, and for many people it was their first language. Here it runs in Bywater BASIC, an interpreter for the classic line-numbered style.

Every line has a number, and the program runs in number order. GOTO jumps to a line, and GOSUB jumps to a subroutine, a block of lines that ends in RETURN. Subroutines take no arguments, and every variable is global, so the programs here pass values by setting variables before each GOSUB. A name ending in $, such as L$, holds text. There’s no sort, no growable array, and no CSV reader, so the implementations write their own.

Quirks

Concepts in BASIC

Run the examples locally

You need Docker and Python 3. The harness builds the pinned container and runs every BASIC example:

git clone https://github.com/qnixon/dswithx.git
cd dswithx
python3 harness/run_tests.py --language basic