gombasic is a Go interpreter for a Microsoft CP/M MBASIC-style dialect of BASIC.
It is intentionally retro:
line numbers, GOTO, GOSUB, RETURN, FOR/NEXT, DATA/READ,
string variables, numeric variables, arrays, files, and an interactive prompt.
The goal is not to modernize BASIC. The goal is to understand it, preserve its odd little weather system, and make it runnable with a clean Go implementation.
Goals
- Implement an interpreter inspired by Microsoft BASIC-80 / MBASIC for CP/M.
- Use Go for runtime, program storage, values, and REPL.
- Use
goyaccfor the parser. - Preserve line-numbered program execution.
- Support direct mode and program mode.
- Build toward broad MBASIC compatibility.
- Maintain a clear semantic contract for every implemented statement and function.
Non-goals
- No graphical extensions in the first implementation.
- No machine-specific PEEK/POKE behavior beyond documented compatibility stubs.
- No compiler backend.
- No speculative VM unless profiling proves it is needed.
- No hidden dialect changes without documentation.
Initial command shape
gombasic
gombasic file.bas
gombasic --dialect mbasic file.bas
gombasic --strict file.bas
Development
go generate ./...
go test ./...
go run ./cmd/gombasic
Documentation freshness rule
Any meaningful change to behavior, architecture, commands, interfaces, semantics, testing strategy, or supported features must review:
README.mdARCHITECTURE.mdTESTING.mdDECISIONS.mdCOMPATIBILITY.mdSTATUS.mddocs/design/semantic-contract.mdWRITING.md
Documentation updates must happen in the same unit of work as the code change.
If no documentation updates are required, the change must explicitly say so.