BBC BASIC - a blast from the past into the future

Discuss other programming languages besides AutoHotkey
ahketype
Posts: 191
Joined: 27 Oct 2016, 15:06
Location: Yorkshire, UK

BBC BASIC - a blast from the past into the future

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

Clipboard Image.jpg
Developing Poolo in BB4W
Clipboard Image.jpg (154.09 KiB) Viewed 8008 times
garry
Posts: 3758
Joined: 22 Dec 2013, 12:50

Re: BBC BASIC - a blast from the past into the future

06 Feb 2019, 11:45

thank you , I'll try for windows , interesting BASIC for many platforms ....
http://www.bbcbasic.co.uk/bbcbasic.html
I just used GWBasic for DOS , was happy to create once 40 Inputfields ( instead 40 * command 'Input' ) , type in known variable and get result ( commandlines for telecom switching network Siemens )
some links , old programs used with autohotkey ( but not needed )
https://www.autohotkey.com/boards/viewtopic.php?f=76&t=59581&hilit=print+rghdruck
https://www.autohotkey.com/boards/viewtopic.php?f=9&t=14411&hilit=PC+1262
How it began : smallest Pocket Computer SHARP PC-1262 ( 1982 ) , later USB added
Image
Image
ahketype
Posts: 191
Joined: 27 Oct 2016, 15:06
Location: Yorkshire, UK

Re: BBC BASIC - a blast from the past into the future

13 Feb 2019, 19:29

Haha, great stuff garry - good to see that photo - I've still got a Sharp pocket computer too, lower spec probably with a single line of text. It's fun trying to see what you can program on really limited machines with about 2k script memory and a rubbish monochrome readout!
burque505
Posts: 1732
Joined: 22 Jan 2017, 19:37

Re: BBC BASIC - a blast from the past into the future

14 Feb 2019, 12:10

@ahketype, @garry, I've got a Sharp EL-5100, sounds like maybe ahketype has one too. Single line of text.
I used it for quadratic equations and general impedance calculations during tests when I was studying electronics, back more or less when dinosaurs roamed the earth. 1980'ish.
garry
Posts: 3758
Joined: 22 Dec 2013, 12:50

Re: BBC BASIC - a blast from the past into the future

14 Feb 2019, 14:12

@burque505, Sharp EL-5100 was earlier with 3-button batteries , I like the newer one ( PC-1262 ) with 2-Lithium batteries CR-2032 , keeps at least 15 years , never lost data ( memory safe guard / auto power off ) / BASIC program
I really use it every day at least for calculation , see all characters what you type in and it's possible to change ( insert /delete / overwrite )
burque505
Posts: 1732
Joined: 22 Jan 2017, 19:37

Re: BBC BASIC - a blast from the past into the future

14 Feb 2019, 16:06

@garry, looks like yours has i/o as well, which mine most certainly does not :).
garry
Posts: 3758
Joined: 22 Dec 2013, 12:50

Re: BBC BASIC - a blast from the past into the future

15 Feb 2019, 04:57

yes, it has connection to TAPE ( save /load ) and printer ( LPRINT "test";C )
Sharp CE-125 combined tape and printer , http://pocket.free.fr/html/sharp/ce-125_e.html

Return to “Other Programming Languages”

Who is online

Users browsing this forum: No registered users and 17 guests