
- hitsware
- Posts: 254
- Joined: Sat Mar 26, 2016 10:12 pm
- Location: sacramento , california , usa
- Contact: Website
Re: Introduction to BBC BASIC

- Attachments
-
- 2020-11-30-092328_1366x768_scrot.png (78.85 KiB) Viewed 1106 times
http://www.hitswares.com/
- RichardRussell
- Posts: 698
- Joined: Thu Jun 21, 2012 10:48 am
Re: Introduction to BBC BASIC
I'm not sure what the point of your post is. That Chromium on the Pi doesn't support WebAssembly threads has been discussed previously here. There's nothing I can do about that! Once again, the list of browsers known to be compatible with the in-browser edition of BBCSDL is:
Desktop versions of Brave, Chrome, Edge, Firefox, Opera and Vivaldi.
Chrome for Android (with WebAssembly threads enabled in the experimental features).
For the best results use Firefox, which is noticeably faster than the others.
Even if it did run on the Pi it would be excruciatingly slow. There is approximately a 3x overhead in running WebAssembly compared with native code, and the Pi is already very slow compared with a typical desktop or mobile device.
Desktop versions of Brave, Chrome, Edge, Firefox, Opera and Vivaldi.
Chrome for Android (with WebAssembly threads enabled in the experimental features).
For the best results use Firefox, which is noticeably faster than the others.
Even if it did run on the Pi it would be excruciatingly slow. There is approximately a 3x overhead in running WebAssembly compared with native code, and the Pi is already very slow compared with a typical desktop or mobile device.
Re: Introduction to BBC BASIC
Thanks for the warning, Richard. I tried the WASM link - https://wasm.bbcbasic.co.uk/bbcsdl.html - in firefox-esr (Firefox v.68) on a Raspberry Pi 4, and it gave a similar exception. Not that I was expecting it to run well after your warning, but I wanted to see if it would run at all.
If you want to run BBC BASIC in the browser on a Raspberry Pi, it seems you're stuck with an emulator: https://bbc.godbolt.org
(this runs painfully slowly for me)
If you want to run BBC BASIC in the browser on a Raspberry Pi, it seems you're stuck with an emulator: https://bbc.godbolt.org
(this runs painfully slowly for me)
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.
Pronouns: he/him
Pronouns: he/him
- RichardRussell
- Posts: 698
- Joined: Thu Jun 21, 2012 10:48 am
Re: Introduction to BBC BASIC
I don't know what determines whether WebAssembly threads will be supported on a particular platform. It may simply be that it's a very new feature, only available for a couple of months on most browsers, and that it's taking time to roll out to less popular platforms.
The only mobile browser that has it currently is Chrome on Android, and even then it's classed as experimental and is disabled by default. So it's possible that it will appear on Raspberry Pi browsers eventually, but it may be that the performance simply isn't good enough to make it worthwhile.
I am paying the price for being an 'early adopter' of WebAssembly threads (I don't know of any other application that uses them), but without that feature my BBC BASIC, which is totally reliant on multithreading, couldn't run.
Re: Introduction to BBC BASIC
Extraordinarily cool, as ever. Not particularly surprising that WASM threads didn't work in firefox-esr, since it's Firefox v.68 and they only came in with Firefox 79 back in July.RichardRussell wrote: ↑Mon Nov 30, 2020 9:11 pmI am paying the price for being an 'early adopter' of WebAssembly threads (I don't know of any other application that uses them), but without that feature my BBC BASIC, which is totally reliant on multithreading, couldn't run.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.
Pronouns: he/him
Pronouns: he/him
- hitsware
- Posts: 254
- Joined: Sat Mar 26, 2016 10:12 pm
- Location: sacramento , california , usa
- Contact: Website
Re: Introduction to BBC BASIC
Happened onto it here :RichardRussell wrote: ↑Mon Nov 30, 2020 5:56 pmI'm not sure what the point of your post is. That Chromium on the Pi doesn't support WebAssembly threads has been discussed previously here. There's nothing I can do about that! Once again, the list of browsers known to be compatible with the in-browser edition of BBCSDL is:
Desktop versions of Brave, Chrome, Edge, Firefox, Opera and Vivaldi.
Chrome for Android (with WebAssembly threads enabled in the experimental features).
For the best results use Firefox, which is noticeably faster than the others.
Even if it did run on the Pi it would be excruciatingly slow. There is approximately a 3x overhead in running WebAssembly compared with native code, and the Pi is already very slow compared with a typical desktop or mobile device.
http://www.thebackshed.com/forum/ViewTo ... &TID=13135
http://www.hitswares.com/
Re: Introduction to BBC BASIC
It's still a little rude to make a "this thing that can't work doesn't work" post by just including an image: some explanation of why you think it should work might've been a start.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.
Pronouns: he/him
Pronouns: he/him
- RichardRussell
- Posts: 698
- Joined: Thu Jun 21, 2012 10:48 am
Re: Introduction to BBC BASIC
I've released version 1.18a of BBC BASIC for SDL 2.0 - the cross-platform programming language for Windows, MacOS, Linux, Raspbian, Android, iOS and in-browser. The changes in this version are as follows:
Please remember that if you use the BBC2APK Android Application Generator you should download a new APK template to ensure that any updates to the run-time engine are incorporated in your own apps.
- BASIC Interpreter / Run Time Engine
Added a new command-line switch -borderless to remove the title bar.
Extended the PTR() pseudo-variable (again) to accept a function or procedure name as a parameter.
Fixed an obscure bug which could cause a star-command to crash if within 256 bytes of the end of a library!
- IDEs and Utilities
Updated BBCEdit to version 0.37.2, which speeds up directory listings when there are many files.
Modified SDLIDE to make the behaviour of Backspace more consistent, for example you can backspace through the line-number field.
- Libraries
Added Svein's excellent pdflib library for creating PDF files (single A4 page only).
Fixed a bug in aagfxlib causing 'dashed' lines to be sometimes drawn slightly too long.
Modified box2dgfx, imglib, shaderlib and webgllib to clip to the current graphics viewport, if any.
- Example Programs
Added saa505x.bbc in examples/tools, to demonstrate the different MODE 7 character sets.
Added raytrace.bbc in examples/graphics, another shader demo from Shadertoy.com (sorry, doesn't run on the RPi).
Updated aagfxdem.bbc in examples/graphics, to check that 'dashed' lines are the right length.
Please remember that if you use the BBC2APK Android Application Generator you should download a new APK template to ensure that any updates to the run-time engine are incorporated in your own apps.
- RichardRussell
- Posts: 698
- Joined: Thu Jun 21, 2012 10:48 am
Re: Introduction to BBC BASIC
I have updated the Console Mode editions of BBC BASIC to version 0.30. The main changes in this version are:
- Changed the 'autorun' priority to favour running a .bbc program, with the same name as the executable, over a program specified on the command line. This allows a utility created using BBC BASIC to accept command-line parameters.
- *DUMP has been extended to accept optional hexadecimal start and end offsets (or start and length) using the same syntax as *LOAD and *SAVE.
- Fixed files created with OPENOUT sometimes being padded with extra bytes (Windows edition only, although could theoretically have happened on the others).
- Fixed an obscure bug that could cause a 'star' command to crash if within 256-bytes of the end of the last-loaded library!
- RichardRussell
- Posts: 698
- Joined: Thu Jun 21, 2012 10:48 am
Re: Introduction to BBC BASIC
I have now added the Console Mode editions to the Github project.RichardRussell wrote: ↑Tue Dec 15, 2020 6:55 pmI have updated the Console Mode editions of BBC BASIC to version 0.30.
Re: Introduction to BBC BASIC
Richard - just a quick note of thanks for BBC Basic after all these years.
Despite being on the other side of the pond, I always enjoyed BBC Basic and it's documentation the most back when I was first introduced to computing. It was either staring at a blank screen, or learning how to do something .
Prior to that, I still have my most prized book from Cambridge and still inspires me today since the author hand-drew everything!
Illustrating Basic (A simple programming language)
by Donald Alcock
Cambridge University Press 1977
ISBN 0 521 21703
I think what gets lost is that Basic, as it initially came from Professors Kemeny and Kurtz at Dartmouth College, was intended for undergrad liberal-arts type students to get access to computing (DTSS time-shared no less!), rather than being denied access by not being in an advanced math/scientific curricula, nor to become particle-physics programmers.
Power to the people! Reputedly, Professor Kemeny had the ability to bring things like E=mc2 to the level of the common man on the street and have them understand.
So to bring things like time-sharing and an easy to use language so that non-brainiacs could actually do something useful, fun, and collaborative was totally mind-blowing.
But I know you know this already. I wish more understood this, but marketing and politics have always overshadowed kids who don't remember the joy of making a computer count to 10, instead of staring at a blinking prompt.
Thanks again for all your hard work all these years!
Despite being on the other side of the pond, I always enjoyed BBC Basic and it's documentation the most back when I was first introduced to computing. It was either staring at a blank screen, or learning how to do something .
Prior to that, I still have my most prized book from Cambridge and still inspires me today since the author hand-drew everything!
Illustrating Basic (A simple programming language)
by Donald Alcock
Cambridge University Press 1977
ISBN 0 521 21703
I think what gets lost is that Basic, as it initially came from Professors Kemeny and Kurtz at Dartmouth College, was intended for undergrad liberal-arts type students to get access to computing (DTSS time-shared no less!), rather than being denied access by not being in an advanced math/scientific curricula, nor to become particle-physics programmers.
Power to the people! Reputedly, Professor Kemeny had the ability to bring things like E=mc2 to the level of the common man on the street and have them understand.
So to bring things like time-sharing and an easy to use language so that non-brainiacs could actually do something useful, fun, and collaborative was totally mind-blowing.
But I know you know this already. I wish more understood this, but marketing and politics have always overshadowed kids who don't remember the joy of making a computer count to 10, instead of staring at a blinking prompt.

Thanks again for all your hard work all these years!
Re: Introduction to BBC BASIC
+1
I also admire his dedication and steady work !
I also admire his dedication and steady work !
- RichardRussell
- Posts: 698
- Joined: Thu Jun 21, 2012 10:48 am
Re: Introduction to BBC BASIC
Keeping BBC BASIC up to date and (hopefully) competitive with other programming languages has only been possible because of the foresight of those who designed it back in 1981. I have always tried to keep any extensions in keeping with the original 'spirit' of the language, and compromises have rarely been required.
Very few languages can claim the degree of cross-platform compatibility that BBC BASIC achieves, even to the extent of 2D & 3D graphics, sound, physics simulation, shader programming etc., allowing programs to be written that will run on virtually any platform without modification. Even 'leading' languages like Python need extensions that are not installed by default (such as pygame) to come anywhere close.
Re: Introduction to BBC BASIC
This is an older dialect of BBC BASIC than you are supporting, Richard, but I was very impressed with Getting Started in BBC BASIC with Owlet, which embeds multiple emulated BBC Micros into the one browser window.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.
Pronouns: he/him
Pronouns: he/him
- RichardRussell
- Posts: 698
- Joined: Thu Jun 21, 2012 10:48 am
Re: Introduction to BBC BASIC
I saw that mentioned at the StarDot forum, it's very clever (although I confess I'm not a 'retro-computing' enthusiast, so the whole idea of running programs on an emulated 1982-vintage BBC Micro leaves me cold).scruss wrote: ↑Mon Dec 28, 2020 8:37 pmI was very impressed with Getting Started in BBC BASIC with Owlet, which embeds multiple emulated BBC Micros into the one browser window.
It would be nice to see something similar for my modern versions, using the in-browser edition of BBC BASIC for SDL 2.0, although I doubt that it would be possible to display the code listing alongside the output in the same way (given that mine is coded in WebAssembly rather than JavaScript). I wonder if there are any web experts out there who might attempt it.

- RichardRussell
- Posts: 698
- Joined: Thu Jun 21, 2012 10:48 am
Re: Introduction to BBC BASIC
What should be achievable, though, is to have a BASIC code editor in one browser tab which opens another tab to run the program. I've confirmed by experiment that if one saves a file to the browser's persistent (IDBFS) file system, and then opens another tab, that file is visible from there.RichardRussell wrote: ↑Mon Dec 28, 2020 9:28 pmI doubt that it would be possible to display the code listing alongside the output in the same way
Re: Introduction to BBC BASIC
I'm not into retro-computing either and wouldn't go back if I could - however the *ideals* are still sound.
I guess I'm in an appreciative mood for both Cambridge and Dartmouth based upon what's under my fingertips, albeit it is a long historical stretch of things not implemented to be productized..
Cambridge Programming Language > BCPL > B > C as the systems programming language that Ken Thompson and Dennis Ritchie implemented on limited hardware for the *nix kernel. Just to provide a nice environment for a small handful of guys that got placed into an attic at ATT.
And oh yeah, what was included in those early *nix releases? A version of basic akin to DEC-Basic. Let the user choose the best tool for the job and their ability.
Whaddy'a know? I've got BBC-Basic and the RPD under my fingertips at this very moment.
Good ideas stand the test of time!
I guess I'm in an appreciative mood for both Cambridge and Dartmouth based upon what's under my fingertips, albeit it is a long historical stretch of things not implemented to be productized..
Cambridge Programming Language > BCPL > B > C as the systems programming language that Ken Thompson and Dennis Ritchie implemented on limited hardware for the *nix kernel. Just to provide a nice environment for a small handful of guys that got placed into an attic at ATT.
And oh yeah, what was included in those early *nix releases? A version of basic akin to DEC-Basic. Let the user choose the best tool for the job and their ability.
Whaddy'a know? I've got BBC-Basic and the RPD under my fingertips at this very moment.
Good ideas stand the test of time!
