BBC BASIC - a blast from the past into the future
Posted: 05 Feb 2019, 19:05
Hi guys,
I thought it was time I gave a shout-out to my other go-to language, BBC BASIC, and see if anyone else here uses it. It was, of course, one of the first widely-used languages on home computers back in the 1980s, designed to be easy to use. Its latest incarnations are BBC BASIC for Windows (BB4W) and a cross-platform BBC for SDL2.0 (BBCSDL), which can be run on Windows, Linux, Android, iOS and Raspberry Pi. I'm not a computer scientist or professional, and in awe of how much other people here know about programming, so don't take any of this as gospel, and do please correct it if I get something wrong.
If you grew up on BASIC like I did, you'll find the language very comfortable, but it's also very powerful now. It's not an emulator of one of the older machines, but takes the best of the old BBC language and uses it to drive the goodies of modern ones.
If you're wondering what languages might be useful to learn, you might find it's got some advantages for certain things, as well as some disadvantages and quirks. One quirk is that it has 'graphic units' two of which correspond to a pixel, but you get used to it. Another is that it has particular default MODEs, where the size of the output window and number of columns and rows of text are set (but you can also create custom ones to your liking, or complete GUI windows of course). It also has the rather neat system of "logical colours", a set of default colours just addressed by number, as well as being able to use RGB ones.
It is a general purpose programming language, so you can do most things on it. Some things that are easy in AutoHotkey, like reacting to system-wide keystrokes, windows appearing, etc., aren't as easy in BBC BASIC, and some things require messaging or system calls, where in AHK they're simpler commands. But there are around 50 libraries included in the BB4W package to handle some of these (most of which I've not used yet). I'm fairly new to BB4W, although I wrote Acorn BBC BASIC for decades. One library I've used is the sprite library - I'm writing a game called Poolo (it's like Pool, but the table is circular).
Where BBC BASIC wins out most obviously is in the graphics commands, since BBC BASIC has native ones built-in, rather than having to call GDI functions. So it might be a good choice for writing games, plotting graphs, etc. Having said that AHK has libraries that go some way to solving this, but it's nice to be able to just say MOVE 300,530:DRAW 500,20 or CIRCLE FILL 300,400,100 and stuff like that. It's a really simple matter to print text to a particular position on screen, even rotated through any angle. As well as graphics using GDI, it has a Direct3D library.
A BBC program has an output window automatically created when you run it, to which it PRINTs or DRAWs text and graphics. There's an Immediate Mode, with a ">" prompt, where you can write statements for immediate processing.
The editor that comes with BB4W is pretty good, and has a number of good utilities. The syntax highlighting is fairly simple, just a couple of different keyword colours, strings, DEFs and comments, but adequate.
I've not tried BBCSDL on Windows yet, but have just started trying it on my Android phone and a Galaxy Tab, and a few years back on a Linux machine. I've just discovered that you can write and test an app on Android to make sure it works, but then you can use a bbc2apk utility on a Windows machine to compile it to a digitally signed .apk for installation or distribution on Play Store.
There are lots of BASIC 'dialects' out there, and some even easier to knock together very simple programs, but I don't know of any that have the extensive and careful development of BBC BASIC, or that do as much (by a long shot) or have anything like decent IDEs. The author, Richard Russell, is also very helpful and active on the relevant forums and groups. BB4W has extensive documentation as a .chm and on the website, with explanations and examples. BB4W is freemium (the free version is memory-limited, but good enough for checking if it's for you, and then not massively expensive). BBCSDL is freeware.
Cheers
ahketype
I thought it was time I gave a shout-out to my other go-to language, BBC BASIC, and see if anyone else here uses it. It was, of course, one of the first widely-used languages on home computers back in the 1980s, designed to be easy to use. Its latest incarnations are BBC BASIC for Windows (BB4W) and a cross-platform BBC for SDL2.0 (BBCSDL), which can be run on Windows, Linux, Android, iOS and Raspberry Pi. I'm not a computer scientist or professional, and in awe of how much other people here know about programming, so don't take any of this as gospel, and do please correct it if I get something wrong.
If you grew up on BASIC like I did, you'll find the language very comfortable, but it's also very powerful now. It's not an emulator of one of the older machines, but takes the best of the old BBC language and uses it to drive the goodies of modern ones.
If you're wondering what languages might be useful to learn, you might find it's got some advantages for certain things, as well as some disadvantages and quirks. One quirk is that it has 'graphic units' two of which correspond to a pixel, but you get used to it. Another is that it has particular default MODEs, where the size of the output window and number of columns and rows of text are set (but you can also create custom ones to your liking, or complete GUI windows of course). It also has the rather neat system of "logical colours", a set of default colours just addressed by number, as well as being able to use RGB ones.
It is a general purpose programming language, so you can do most things on it. Some things that are easy in AutoHotkey, like reacting to system-wide keystrokes, windows appearing, etc., aren't as easy in BBC BASIC, and some things require messaging or system calls, where in AHK they're simpler commands. But there are around 50 libraries included in the BB4W package to handle some of these (most of which I've not used yet). I'm fairly new to BB4W, although I wrote Acorn BBC BASIC for decades. One library I've used is the sprite library - I'm writing a game called Poolo (it's like Pool, but the table is circular).
Where BBC BASIC wins out most obviously is in the graphics commands, since BBC BASIC has native ones built-in, rather than having to call GDI functions. So it might be a good choice for writing games, plotting graphs, etc. Having said that AHK has libraries that go some way to solving this, but it's nice to be able to just say MOVE 300,530:DRAW 500,20 or CIRCLE FILL 300,400,100 and stuff like that. It's a really simple matter to print text to a particular position on screen, even rotated through any angle. As well as graphics using GDI, it has a Direct3D library.
A BBC program has an output window automatically created when you run it, to which it PRINTs or DRAWs text and graphics. There's an Immediate Mode, with a ">" prompt, where you can write statements for immediate processing.
The editor that comes with BB4W is pretty good, and has a number of good utilities. The syntax highlighting is fairly simple, just a couple of different keyword colours, strings, DEFs and comments, but adequate.
I've not tried BBCSDL on Windows yet, but have just started trying it on my Android phone and a Galaxy Tab, and a few years back on a Linux machine. I've just discovered that you can write and test an app on Android to make sure it works, but then you can use a bbc2apk utility on a Windows machine to compile it to a digitally signed .apk for installation or distribution on Play Store.
There are lots of BASIC 'dialects' out there, and some even easier to knock together very simple programs, but I don't know of any that have the extensive and careful development of BBC BASIC, or that do as much (by a long shot) or have anything like decent IDEs. The author, Richard Russell, is also very helpful and active on the relevant forums and groups. BB4W has extensive documentation as a .chm and on the website, with explanations and examples. BB4W is freemium (the free version is memory-limited, but good enough for checking if it's for you, and then not massively expensive). BBCSDL is freeware.
Cheers
ahketype