Python Provides Classic Basic

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.

22 thoughts on “Python Provides Classic Basic

  1. 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.

    1. 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.

      1. 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.

  2. 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.

Leave a Reply to Feinfinger (M-x totally-tame-mode)Cancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.