Wacci: Autumn 2001
B is for Basic
Sean McManus introduces Amstrad Basic and puts the case for it being the best 8-bit Basic version.
By the time the Amstrad came along, Basic was the default programming language on most home computers including the competing Acorn, Commodore and Sinclair machines. The language itself dates back to 1964 and was invented by John G. Kemeny and Professor Thomas Kurtz at Dartmouth College. Their goal was to create a language (a Beginners' All-Purpose Symbolic Instruction Code) that would enable users to write programs easily. It should be forgiving, and allow for obvious information to be omited and provide useful error messages. It should shield users from needing to know anything about the hardware, and it should be extensible so more advanced users could make the most of the machine. Compared to machine code (which locks up the machine if you get it wrong, without any error messages), Basic is a doddle.
And the language did inspire people. In the eighties it seemed we would conquer the world by learning to program our home computers. A public domain scene was built around enthusiasts writing programs to meet their needs, either because there wasn't anything specific enough on the market or because they relished the challenge of coding from scratch. Bedroom games programmers were becoming famous and getting signed up with major software houses, and Basic was the first step to stardom. I knew someone in a small business who taught himself to program his Spectrum so that he could run his stock management on it. Data was loaded from tape and the print-outs had all the archival qualities of a till receipt. But all this, we thought, was going to be the future.
Programming was well-supported by magazines, with Amstrad Action carrying listings and coding tips until its closure. In the early days, Amstrad Computer User published listings that ran not only over pages and pages of an issue, but also serialised programs between issues. It seems incredible now that people typed these in, but many of them found that playing with these programs gave them the first insight into how they might write their own. Nor were these programs sub-standard. Some of the authors had clearly been inspired by Amsoft's games to create something better and cheaper for computer users, and given the standard on the market at the time, it was relatively easy to impress.
Over time, published listings got shorter and ACU started a regular 10 liners section. The brief was to create something impressive, useful or interesting in ten lines or fewer. The quality varied a lot and the end result was usually of more interest to other programmers than end users. While people could type in the multipage games listings in the early days and enjoy playing them, the 10 line games were too simple to have lasting appeal. To appreciate any beauty in them, you had to like looking at how they were written. Some useful utilities appeared on these listings pages, but there were many trivial demonstrations that catered much more for the author's urge to show off than for any unsatisfied programming need among readers.
One reason that the CPC could sustain a community of programmers for so long after the other 8 bit machines had been found out for being toys is that the version of Basic that came with the machine was so good. It was written by Locomotive Software, a team who worked for Acorn previously. It allowed programmers to do nearly everything that the machine's own built-in programs could do, although machine code programmers would later teach the machine new tricks. The demonstration tape which ran on machines in shops, which was designed to amaze and delight its audience with various light shows and software demos, was itself largely written in Basic and some of the early games on the machine were also coded in Basic.
The few omissions in what Basic could do were mostly included in Basic 1.1, an updated language with a few new commands which featured on later computers. These new commands included a fill routine and a command to find out what text character was on-screen at a particular point. Had these appeared earlier, they might have been more useful, but most programmers were aiming for cross-compatibility between the early machines and the later ones with the programs they wrote so the new commands were largely ignored. Magazines and software houses insisted on compatibility, and even PD libraries preferred programs that worked across most machines unless there was a good reason why they shouldn't. Memory management remained clumsy, a missed opportunity to make it easier to exploit the potential of the 128K machines.
But Basic was slow. It's an interpreted language, which means that each time a command is run, the computer has to translate it into machine code before it can do anything with it. This translation meant that Basic would never be enough for actions that need speed like graphics handling. Luckily Amstrad Basic could be combined with machine code by using RSXs. These were commands preceded by a bar that could be added to Basic by running a machine code program. When the command was entered, the machine code was run.
Programming Basic enabled many Amstrad users to invent their own worlds on their home computers. It was an intellectual sport, where there was pride in pushing the machine and making it do something new. And for many people, programming the machine was more satisifying than playing the games that were available for it.
As it turned out, learning Basic wasn't the way to conquer the world. Computers became too complex for that and applications like spreadsheets and database programs became powerful enough to meet even the most esoteric requirements. The point and click interface means that most home computers don't even have a programming language installed now for people to use if they want to begin coding. Nor are computers standardised enough for Basic to enable users to leverage all the hardware's features.
But those Amstrad users who learned to program will never fear the lack of software for the machine. If ever they need it to do something new, they'll flop open the manual, play their favourite album and let the good times roll.
I've revived the idea of 10 line programs in my 10 Block Scratch demos. If you like the idea of using a computer to learn music theory, as I did with my CPC Chords Tutor, check out Clef Hero for the Raspberry Pi.