[GTALUG] For Chris: Commodore BASIC as a scripting language

Stewart C. Russell scruss at gmail.com
Fri Aug 16 12:51:06 EDT 2019


On 2019-08-16 11:52 a.m., D. Hugh Redelmeier via talk wrote:
> 
> | I've been spending more time with BASIC on Linux than I should recently.
> 
> Why?  Legacy code?

I thought you knew me well enough never to ask why, Hugh.

> I cannot think of anything better done in BASIC rather than in Python
> or Logo.  And that's just for things in BASIC's niche.

Find me a computer that booted from ROM into a Python or Logo REPL and I
might believe you. There are some new tiny computer-like things shipping
with MicroPython in flash, but Python lacks exuberance. No-one ever
stayed up late trying to pack a Python program into a single < 255
character line limit because they could*.

> I have to admit that a good implementation of a bad language is often
> more useful than a bad implementation of a good language.

BASIC isn't a bad language even if EWD had a hate-on for it. It's one of
those get-the-job-done practical languages like Fortran, Cobol and Perl
that seem to annoy computer scientists. I mean, you've got to love a
language that when you ask it to reserve 10 array items it gives you 11,
just so FOR i=1 TO 10 and FOR i=0 TO 9 won't fail …

BASIC isn't rigidly defined, beyond a tiny subset lacking any useful
library (ANSI X3.60-1978, with accompanying test suite NBS SP 500-70).
It took Microsoft five versions before they hit that standard, just so
they could sell BASIC systems to the US federal government. There is a
current ISO BASIC standard, but I don't quite have enough interest to
shell out the $$$ to find out what it includes.

cheers,
 Stewart

*: this one-liner, running in an emulated BBC Micro in a browser,
remains one of my favourite games:
<https://bbc.godbolt.org/?autorun&loadBasic=https://gist.githubusercontent.com/scruss/8ba31a3fc154042285d21cf7ffdfff69/raw/9007afc9d252f4866f93cfc8f474b1d8ea6a76ee/ASTER>
(caution: loud beep at start. Hold Return to climb, let go to not-climb.
Don't hit anything you can see. Space restarts. The game's called
Asterisk Tracker, and was a major reason for broken Return keys and
unfinished computer homework in the 1980s in the UK.)


More information about the talk mailing list