A cross-platform interpreter for classic, line-numbered BASIC, written in Go. It targets Microsoft 8K BASIC behavior and is continuously exercised against all 112 byte-distinct original BASIC programs in the pinned BASIC Computer Games corpus.
- Run classic BASIC programs on Linux, macOS, and Windows.
- Get actionable source, BASIC-line, and runtime diagnostics.
- Reproduce programs with controlled random seeds and statement limits.
- Depend on a small Go codebase with no third-party runtime dependencies.
- Verify compatibility against every distinct source in a pinned historical corpus.
Download a checksummed archive from the latest release, or build from source with Go 1.26.6 or newer:
git clone https://github.com/scottdensmore/go-basic.git
cd go-basic
make build
./bin/go-basic test/scripts/test.basExpected output:
Hello World
1 1
2 4
3 9
4 16
5 25
| Guide | What it covers |
|---|---|
| Getting started | Installation, CLI options, input, reproducibility, and errors |
| How it works | Source preparation, lexing, parsing, evaluation, and package boundaries |
| Language reference | Supported syntax, statements, operators, functions, and extensions |
| Compatibility | Pinned corpus, acceptance tiers, results, and known upstream exception |
| Contributing | Development workflow, testing expectations, and pull requests |
| Security | Supported versions, private reporting, trust boundaries, and limitations |
| Code of Conduct | Expected behavior and reporting options for project spaces |
go-basic supports numeric and string values, arrays, arithmetic and 16-bit
logical operators, subroutines and loops, interactive input and formatted
printing, DATA/READ, user-defined numeric functions, and the common
Microsoft BASIC numeric and string function set.
The language reference is the source of truth for the implemented language surface. Passing the external corpus is strong compatibility evidence, not a claim of universal support for every BASIC dialect or hardware-specific feature.
go-basic is available under the MIT License.
