Files
lttb/README.md
T
2026-06-13 20:21:49 +03:00

3.6 KiB
Raw Blame History

Luxferre's Truly Tiny BASIC (LTTB) implementations

About

Luxferre's Truly Tiny BASIC (henceforth LTTB) is a lean dialect of the BASIC programming language, originally based upon the Dennis Allison's design notes for Tiny BASIC with some improvements inspired by Tom Pittman's 6800 Tiny BASIC variant. Just like the original Tiny BASIC designs, LTTB aims for maximum portability and minimum implementation complexity.

Specification

The LTTB specification expands upon the original Design Notes in the following manner:

  • Line numbers from 1 to 32767 are supported.
  • Any invalid statement (including REM) can be used for comments.
  • No command can be abbreviated inside IF statements.
  • LET and THEN keywords are optional.
  • IF statements also allow inserting line numbers after THEN, making it possible to write self-modifying programs.
  • A special RND(n) function is introduced that generates a random number from 0 to n-1.
  • The NEW command is synonym to CLEAR.
  • The BYE command can be used to exit the interpreter.
  • In the environments that support file systems or some kind of external file I/O, the LOAD command can be used to load BASIC programs into memory, and the SAVE command can be used to save BASIC programs from memory.

See the manual for more details on every supported command and the examples directory for working examples.

If you want to create your own implementation of LTTB, see the Implementation Notes document for the details on the internal interpreter workings.

Implementations

Here are all currently known implementations of LTTB:

FAQ

Please read the manual first, your question is most likely covered there. If not, here are some more questions and answers.

Why make another Tiny BASIC clone in 2026?

Because it's a 1) great benchmark for any languages I'm currently mastering, 2) way to run vintage software and games, 3) nice practice for classic, hand-crafted coding.

Besides, the goal is not just to make one implementation and call it a day, but to port it to as many host languages and platforms as possible. I'd even say that eventually the implementations themselves may become more of a byproduct and the main value will reside in the design docs crystallized in the process.

Which TB dialects is LTTB compatible with?

In general, you should be able to run anything compatible with:

  • the original Design Notes by Dennis Allison;
  • the original Tom Pittman's 6800TB (if the program doesn't have any USR calls and has proper spacing between the command and the rest of the statement);
  • the Damian Gareth Walker's implementation, provided all program lines are properly numbered (because that implementation uses autonumbering when loading the programs).

Will there be any TBX (Tiny BASIC Extended) or PATB (Palo Alto Tiny BASIC) compatibility?

No way.

But are the existing implementations really tiny?

I think 300 SLOC of Jim Tcl for the entire interpreter (including the banner etc) is pretty tiny. Other implementations are also projected to be within this ballpark.

Credits

Inspired by the great works of Dennis Allison and Tom Pittman.

All LTTB implementations in this repo were created by Luxferre in 2026 and released into the public domain with no warranties.