Back in the late 1970s and early 1980s when you turned on a PC, more often than not, you’d get a Basic prompt. Most people would then load a game from a tape, but if you were inclined to program you could just start writing. [Richpl] wanted that same experience and thus PyBasic was born. Along with some other Github contributors, the system has grown quite a bit and would be a good start at porting classic games or creating a replica vintage computer.
The interpreter lacks specialized hardware-specific features such as sound and graphics, of course, but then again, you could add them. It does have file I/O and also includes some interesting features like an analog of C’s ternary operator.
There are line numbers and if you are looking for a way to contribute, the program is lacking a renumber feature. There are a few oddities around handling numerics. For example, you can assign a string to a number (which could be a feature) and there’s an extra space in negative number output. Leading zeros are not optional for numbers less than one. You can use colons to put more than one statement on a line, but not if they are part of a loop. So there are lots of ways you could contribute if you were so inclined.
We hear that [Richpl] is working on an Oregon Trail port and already has a text adventure, Star Trek, and Eliza working. If you decide to play with this, you really need this book. We still like computers that boot to Basic.
A while back, I wanted to play ICBM. (From More BASIC Computer Games) Rather than translate it into Python, I wrote a very simple (And specific) BASIC interpreter in Python.
I don’t think anyone implemented it that way, but TinyBASIC as spelled out by PCC in Dr. Dobbs was to have 2 layers. An inner interpreter that would be rewritten for each CPU, and an outer BASIC interpreter.
So BASIC written once, and presumably the inner interpreter simple and easy to port.
This is the first time I’ve heard this, but on one port of Palo Alto Tiny BASIC (to the F8, DDJ Oct 1979) the author credited Li-Chen Wang with writing the original in an elegant structured style that it was easy to go from 8080 to F8.
It’s all there in t he archived issues. I guess Dr. Dobbs reprinted the article from PCC because I’m sure I’ve read it.
Apparently there were a couple of implementatiins of the two layers. Tom Pittman used it in his more commercial tiny BASIC, which explains why he had versions for so many CPUs. And at least one version that appeared in Dr. Dobbs.
But yes, the Palo Alto version came early and I don’t think it has an inner interpreter. It seemed to have the most descendants, I bought a copy of Dr Dobbs because of the 6809 version.
This inner iinterpreter was probably the virtual machine that interpreted the tokenized Basic.
If I had a nickel for every time I have done this sort of thing I could actually buy a coffee at Starbucks today.
I have to respond to this.
WHY?
1 intrepeter language. Hey! let’s add another one on top of that!
….are they planning add ‘Logo’ to that pyBasic?
We need MORE layers!!!
Then implement Python in Logo so you never have to stop…
Look around you!
Have you finished your programming exercise? Now hand in your copybook to your teacher or head of class.
I want a clone of HP2000C BASIC with High Speed Drum, Disk Pak, and Tape drive. Also 31 users with dialup 110 baud modems, and a system console. All written in Java 17.
The first book on BASIC I encountered described the MAT … matrix statements and I have wanted BASIC to have them ever since. Sure you just substitute with loops but there it was, built in.
BAS has MAT.
—▷ http://www.moria.de/~michael/bas
HP had MAT in 1969 (HP2000A Time Share BASIC)
was that the Singer BASIC book?
the one with the dark(ish) blue/mauve cover???
No, it was ‘BASIC for Everyone’ by Thomas Worth, published 1976. It is blue with the title in a green circle on the cover.
I’m writing a python interpreter in basic. Parenthesis and semi-colons are obligatory and tabs are ignored but otherwise it’s fully compatible.
…like https://github.com/mathialo/bython ?
works on devices too, made a quick vid’ – https://youtu.be/d4x1OEPUvUI
Another video of PyBasic running on an RP2040 – https://www.youtube.com/watch?v=XvoAAy5tObk
Nice work. Learning some useful skills here.