Periodically, my interest is captured by BASIC interpreters, present on virtually all hobby and home computers since the mid-70s and especially in the 80s. Among the various dialects of BASIC, Tiny BASIC certainly plays a very important role.
Tiny BASIC was conceived between 1975 and 1976 and its development as an open alternative to Microsoft‘s expensive BASIC was boosted by the controversy on hacking and piracy, triggered by the unauthorized distribution of several copies, denounced by Bill Gates in his Open letter to hobbyists.
Tiny BASIC interpreters were released free of charge or marketed at low cost; among these, the most famous is the interpreter implemented by Tom Pittman (Itty Bitty Computers) via virtual machine, to whose story Steven Levy dedicated a chapter of his Hackers: The heroes of the computer revolution. In 2006, Tom Pittman released an updated version of his interpreter, rewritten in C language and later Mohan Embar ported it to Java, C# and Flex/Actionscript.
In recent years, WebAssembly (Wasm) technology is establishing itself as a standard for the development of performing web applications, made in other languages besides Javascript.
In particular, just a month ago, Microsoft officially released Blazor WebAssembly, a WebAssembly-based environment that allows the execution of .NET code directly in the browser, without the need to install any additional plugins.
Working daily with C#, the release of Blazor WebAssembly aroused my interest, and so I decided to combine the desire to delve into this new technology with the passion for retrocomputing by creating a Tiny BASIC environment contained in a web page and running on the browser. Blazor WebAssembly allowed me to include the Mohan Embar’s interpreter without any modification to the source code and to create a simple I/O console and the components for loading and running either some predefined BASIC programs and other program filess that may be present on your computer.
The result of this project is TinyBasicBlazor, whose source code is available on GitHub. To complete the work, I started the conversion of MaN1cPuzzle (a 20-Liner ZX Spectrum BASIC implementation of the 15-Puzzle) to Tiny BASIC and I hope to include it soon among the example programs.
With TinyBasicBlazor, you can code like it’s 1976 (but with a modern browser)!
Links & References
- TinyBasicBlazor
- Tom Pittman‘s TinyBasic page is by far the most comprehensive resource on Tiny BASIC, including original and updated versions of his interpreter, sample programs and documentation:
- retrotechnology.com hosts an OCRed version of Tom Pittman’s The First Book of Tiny BASIC Programs
- Mohan Embar ported Tom Pittmans’s TinyBasic C rewrite to Java, C# and Flex/Actionscript; TinyBasicBlazor is based on the C# port
- Steven Levy dedicated a chapter to Tom Pittman’sTiny BASIC in his Hackers: Heroes of the Computer Revolution (chapters 1 and 2 available here)
5 thoughts on “A Tiny BASIC interpreter in your web browser!”
Can you please provide instructions of how to run this locally on your own machine please? Thanks!
Hi! TinyBASICBlazor is built around the C# port of the TinyBASIC interpreter by Mohan Embar, who kindly made both the source code and the compiled versions of his ports available in his TinyBASIC webpage.
If you are using Windows, to easily run the interpreter, simply download the TinyBasic.tar.gz archive: https://www.thisiscool.com/TinyBasic.tar.gz and extract its contents. Then locate the
CSharp\TinyBasic\TinyBasicUI\bin\Debug
subdirectory and double click the TinyBasicUI.exe file to run the interpreter. To load a program, you can just copy and paste the BASIC code in the interpreter window.I have added some build and installation instructions in the README.md file on the TinyBASICBlazor GitHub repo.
I’m couroius, and a beginner in this, and i’d like to know…running tiny basic can be considered applying emulation or only compilation technique?
Hello and thank you for your interest in Tiny Basic!
I’d say that this browser version of Tiny Basic is just a modern implementation of an old interpreter, so technically neither compilation nor emulation.
The Basic code is interpreted and executed without compilation (you can search for the difference between compilers and interpreters, even if with some languages the border is not so clear). Emulation would be executing the an interpreter within a program, simulating the original hardware/software the interpreter was designed for, but running on a different system.
In this post: https://retrobits.altervista.org/blog/2022/12/the-christmas-star-challenge/ there is an example of a tiny basic program running either in TinyBasicBlazor and in the interpreter designed for the COSMAC ELF computer, emulated on a windows PC using the EMMA02 emulator. In both cases the BASIC program is interpreted: in the first case directly by TinyBasicBlazor running on the web browser; in the latter by the old interpreter running on the emulated COSMAC ELF computer, emulated in my PC.