-
Notifications
You must be signed in to change notification settings - Fork 33
Home
1976 was the year of BASIC interpreters. The legendary Dr. Dobb's magazine published many articles on designs and implementations of Tinybasic interpreters. The articles are really fun reading. Bill Gates had build his legendary MS BASIC interpreter in 1975 and of course Steve Wozniak released Apple 1 BASIC.
In the rainy summer weekends of 2021 I decided to write a BASIC interpreter from scratch. Palo Alto and Apple 1 BASIC were the starting points. After that the project has grown quite a bit. It is now a Dartmouth standard type BASIC with (optional) floating points numbers, strings, arrays and IoT capabilities for various micro controllers. It has display drivers, hardware access and a few other unusual features for BASIC.
The core BASIC language was based the specifications of the Dr. Wang Palo Alto BASIC using the December article published by Roger Rauskolb [Palo Alto BASIC]. No code from any source was used, just the language specification.
The second source of is Steve Wozniak's preliminary manual on Apple 1 basic. The interpreter is compatible to the 1976 Apple Integer BASIC. See [here for differences and language features]. It uses the string logic of Apple Integer BASIC which is not compatible with MS or Dartmouth BASIC.
It is worth mentioning the legendary book 101 BASIC Computer Games as well. It is said that this was one main source of inspiration for Apple Integer BASIC. I ported 80 games as test programs for the interpreter. 101 Games. In the version I was using they were originally written in MS BASIC, first published for the MITC Altair computer in 1975.
The language is described in Altair BASIC. This rapidly became the standard for BASIC interpreters from 1976 on for its completeness and usability. One has to admire the 20 year old Bill Gates for this work of software engineering. The original fitted in 4k of memory and had floating point. I used some of the features of this language as well (TAB behaviour).
The implementation here grew beyond the Apple Integer BASIC language set and now offers floating point, printing, terminal support, Arduino I/O and file I/O as optional language set. Networking and some IoT features are also added. Storing in and running programs from EEPROM is possible on the AVR platforms. SPI RAM can be used to build a 32kB computer based on an Arduino UNO. Building standalone computers is possible. See the project page for more info on what one can do with this piece of software.
Only after I completed most of the work, I discovered how similar the approach is to the Cromecon 10 Structured BASIC. It is the only full featured "old time" BASIC I know that uses substring notation. While this BASIC dialect is much more advanced than my work, it seems to be based on the same concepts. The Cromecon 10 was no commercial success. It disappeared rapidly and I didn't know about it back then. The BASIC, however, is just what I would have like to have in the old times.
The interpreter runs on Arduino AVR 8bit and 32 bit platform. Systems like ESP8266 and ESP32 are supported as well as the SAMD and MbedOS microcontrollers. STM32 and the Infineon XMC platform has been added recently. Raspbian is also supported including some basic I/O through the wiringPI library.
The current released version is 1.4. It comes with binaries for DOS, Mac, Windows, and Raspbian.
An Arduino based standalone computer using this BASIC interpreter:
The old time BASIC interpreters where standalone OSes for the hime computer. They handled the hardware and made the computer usable for beginners.
IoT BASIC has a number of device drivers to build standalone systems.
Storage can be SD cards, ESPSPIFFS, Littlefs are supported as mass storage devices (supported devices and filesystems).
A number of displays from small to big can be connected. VGA output is available on ESP32 (supported devices).
Keyboards and keypads are supported directly (supported devices).
Ethernet and Wifi are supported as network protocols to send MQTT messages (network quick reference).
Some of the most common sensors for Arduino are supported as part of the code (sensor library)
One main difference to other BASIC interpreters on the Arduino platform is this device support. IoT BASIC is not only a BASIC interpreter. It has many build in capabilities that make development of little applications easy and fast.
The interpreter and device layer can be extended as they are modular.
Introduction articles in this Wiki