Sinclair BASIC comes to Raspberry Pi
Or Linux, Windows and Pandora
The 80's are so now, as hot on the heels of the RISC OS' Raspberry Pi debut comes the equally retro-tastic news that the BASIC version used in the Sinclair ZX Spectrum can also run on the Pi.
The BASIC in question is SpecBAS, is a project run by a chap called Paul Dunn.
Full Pi support came to the project with the recently-released version 0.755.
SpecBAS is billed as offering “all the features of Sinclair BASIC” , but also adds the following:
- Procedures, with both referenced and normal variable parameters
- Flow control with DO..LOOP, WHILE..LOOP, DO..UNTIL
- Better array handling, with variable BASE settings and FOR..EACH support
- Better string handling with LEFT$, RIGHT$, MID$, REPEAT$ etc
- Memory banks which can be loaded, saved and utilised to hold a variety of data types
- Many, many more maths functions, with both radians and degrees support
- Graphics with 8bpp in any supported resolution with full palette changing, rotation, scaling etc
- Sound support with MOD/S3M/XM/IT/MP3/VOC/WAV etc
- Turtle graphics, sprites, tilemaps.
The language also offers mouse support, which will sadly make the Kempston mouse redundant. On the upside, SpecBAS busts the 48K memory limit, which may or may not be a good thing depending on your appetite for large BASIC projects.
To get SpecBAS working on a Pi, you'll first need to run a linux distribution with hard floating point support. Raspbian Wheezy, the distribution recommended by Raspberry, fits the bill.
The software is free and available here. ®
a) It can be done.. The root of all evil, but in this case rather innocent.
b) Nostalgia. Quite a few of us commentards started out on/with this kind of BASIC, or one of it's contemporaries.
c) Education. There's several ways BASIC can be used to teach logical and programming concepts to kids who otherwise have trouble grasping said concepts *because* of it's linearity, limitations, and relative simplicity.
d) FUN. Which concept may have eluded you lately. Go get some. It's healthy.
Better string handling with LEFT$, RIGHT$, MID$, REPEAT$ etc???
I believe the Sinclair BASIC method of string splitting is VASTLY superior to the crippled crappy Commodore method. I think Dunny only added those retarded commands to pander to the people unfortunate enough to have had to endure Microsoft BASIC (of which Commodore BASIC was one dialect).
The Sinclair method is clear and simple, no need to differentiate between left right and middle.
take something off the beginning? PRINT A$(TO 5)
take something off the end? PRINT A$(5 TO)
take something out of the middle? PRINT A$(3 TO 7)
And with the use of such functions as LEN, you could do all kinds of things with that simple format,.
Paris, because Sinclair string splitting was so simple even she could use it.
The point is getting a result
Only a couple of years ago I needed to generate a load of very similar HTML pages. I could have used a proper language but the project was so simple that it was much faster to do in the ultimate procedural language where syntactic errors were flagged up 'in flight'.
Object orientated coding is not optimal for quick & dirty one-offs. IT 'professionals' sometimes forget that.
Re: The Point?
Ah you deluded BBC owners. I remember you crying yourselves to sleep because your parents wouldn't buy you a Spectrum so you could play all the superior games your school mates were playing.
My, what a cheery soul you are.