Celebrating 50 years of BASIC
On May 1, 1964, Professor John Kemeny ran the first BASIC program from a timesharing terminal at Dartmouth College, and ushered in a new era in accessible programming. Growing up in the 1970s and 1980s, BASIC tended to be the first language that children of my generation came across; despite well-known claims to the contrary, many of us are doing just fine.
We’ve got a few goodies to help get you in the party mood.
First up, our friends at RISC OS Open have produced a disk image for the Pi which boots straight into BASIC V for that authentic retro feel. BASIC V is the direct descendant of Sophie Wilson’s original BBC BASIC, which I cut my teeth on back in the late 1980s, and is therefore officially the best BASIC ever. RISC OS Pico comes bundled with a heap of demos illustrating how BASIC V programs work and how to do things like control the Pi’s GPIO lines, and a free copy of Martyn Fox’s book, First Steps in Programming RISC OS Computers.
Inspired by all this BASIC nostalgia, a couple of weeks ago I broke out a copy of BeebEm and started writing a BBC BASIC version of popular timewaster du jour 2048. It comes in at about 6K of BASIC, machine code and data.
It all got a bit out of control, and to be honest there’s rather more 6502 machine code (and rather fewer comments) than I’d originally intended, but it runs at a solid, flicker-free 50Hz in Mode 2, and gets the Liz “office champion” Upton seal of approval. (Liz asks that I point out that this screenshot was not taken when she was playing the game, because she is proud. She got over 10k points on her first and, so far, only session testing this version of the game, while complaining that it was “a bit hard” because I ran out of colours for the higher-scoring numbers.) You can grab a disk image here; load it up in BeebEm, hit Shift-F12 and enjoy.
Finally no BASIC post would be complete without a plug for Gordon Henderson’s splendid Return To Basic, a modern BASIC interpreter for Raspbian with built-in support for the Raspberry Pi GPIO pins. Gordon’s “BASIC at 50” post is here.
30 comments
Davespice
Brilliant!
Stewart Watkiss
It’s good to see that Basic is still alive and kicking.
For a while I was of the opinion that it had served it’s time and to let it be consigned to the history books, but that was before I tried Basic programming with my 8 year old daughter.
My daughter was already familiar with Scratch (she’d attended a Code Club I ran at her school) and I’d tried her with a bit of Python. With no disrespect to Python (I ♥ Python) the obsession with exact spacing whilst good for ensuring coding standards made it very frustrating for my daughter.
I was sent a Raspberry Pi Fuze on temporary loan and gave my daughter a taste of Fuze Basic. She was much happier programming in Basic than with Python. We have only done some simple text based programming and some flashing LEDs, but she found it much easier than programming in Python.
I don’t think Basic would be many peoples first choice for “serious programming”, but it’s still got a place as an teaching language that is more complex than Scratch, but easier than Python.
David J Noble (@DavidJNoble)
Some very good feedback … code club … I must bring that idea to our school (EDEN primary, North London) .
Gordon Henderson
You’ve done it now, haven’t you. I now have to write “2048” in RTB for all to enjoy ;-)
Three cheers for BASIC!
-Gordon
Duncan
There’s nothing wrong with BASIC, a fine language which can accomplish many things, but I’m surprised you used unsupported Win XP as the emulator host for your demo.
Darren Douglas
Basic V was my first “upgrade”. I remember suddenly haveing two new awesome commands MOUSE ON and MOUSE x,y,b ;)
winkleink
I know it’s not BASIC related but it is Scratch
2048 done in Scratch :http://scratch.mit.edu/projects/19826069/
I’ve lost hours to this already.
Oh – yeah. Love BASIC. Learned all my bad habits with BASIC. Probably be the same bad habits if I was using any other language available at the time.
Michael
I have been writing (in my spare time) my Music Library Program and Car Player in BBC BASIC.
The limitation to the amount of catalogued tracks are down to the memory available in the machine… and on the Pi under (full blown RISC OS Image) thats a lot… I have over 20,000 in mine.
Both my 10 yo daughter, and 6 yo son have written (fairly complex) programmes on my BBC Micro.
Happy Birthday BASIC!
Ben Pirt
Very nice! Makes me very nostalgic for the good old BBC which is where I was first introduced to Basic.
Just yesterday I was feeling all nostalgic about Turtle programming too as I used the Pi and the robot I’ve been building to make a modern equivalent of the BBC and the Turtle:
http://mirobot.io/blog/2014/04/29/raspberry-pi-scratch-and-mirobot/
The other comments about basic being a great learning language when compared to Python are spot on. I love Python but the whitespace can make it really hard for kids to start with. Basic is a lot more forgiving and keeps things quite procedural and simple.
Michael
“best Basic ever”. I think I’d have to say it’s the latest version of VB.NET IMHO. Although I must say I did some nice things with RM Basic at school (A-Levels) 25 years ago.
Giles
This might just be the answer to my prayers – a simple, no-frills, doesn’t-have-to-connect-to-the-internet environment and a decent BASIC that will let me access the Pi I/O in a sensible way. I’ve been waiting ages for something like this. Can’t wait to try running it – I hope it is as easy to get booted as the instructions suggest.
Mark Daniels
@ Giles
It is even easier than they say. I literally copied the files across to a blank SD card using a Ras Pi and then booted the Pi from the card. Boot takes about 10 seconds. I didn’t believe it would work, as I had no defined boot sector!
It’s great to be back in BASIC. I know it’s not the greatest language today, but it is so easy to use and for simple routines it is ideal.
Thanks for making BASIC available on the Pi. It is amazing to see so much free RAM on a 512 MB PI. I am used to seeing about 8 kB on Pets and TRS-80s! ;)
ukscone
Cool
Steve Ligett
http://www.dartmouth.edu/basicfifty/
Jecel Assumpcao Jr
I am a bit surprised at the various comments about how formatting makes Python hard for children. Aren’t there any special editors that take care of this? Or does everyone use vi or something like that? I did program a bit in Occam in the early 1990s and that language also used formatting to indicate structure. The folding editor from Inmos was a bit clunky, but did the job better than a regular editor. And we were limited to pure text in those days, so I no reason why an editor for Python couldn’t look like Scratch.
clive
The default editor that comes with Python (IDLE) does stuff like indenting a new code block (indicated by a colon).
AndrewS
“no reason why an editor for Python couldn’t look like Scratch”
Indeed. http://programmingusingpython.blogspot.co.uk/2012/10/google-blocky-and-python.html
Stewart Watkiss
It’s not just the spacing that children find difficult when moving to Python, but that is one example of something I experienced with my daughter.
She had learned Scratch first, we then did some Python together (not much – mainly with Minecraft at PyconUK), she then did a reasonable amount of Basic (worked through all the cards provided with the Fuze and created her own game) and then did some more Python programming. It was during the second bit of Python programming that she said “[Python] is so fussy. I wish this was basic”.
The programming my daughter has done in Python has all been in IDLE (which is light years ahead of the Basic editor she was using). It does handle the indenting (in terms of hitting return gives you the same indent as the previous line), but doesn’t do code folding (maybe that would help).
My daughter is still fairly young to be programming. I grew up during the 80s when Basic programming was all the rage, but I would have been older than my daughter when I had my first computer. I do think that Python is good for secondary school children, but basic gives an alternative to Scratch that is easier than jumping straight into Python for younger programmers.
This is my own experience, but it’s something that surprised me at the time. I started the Basic programming with low expectations, but found it worked well.
I have looked at blocky, but not used it yet. I like the physical computing side, which is a bit limited when programming in a browser.
Jecel Assumpcao Jr
Thanks for the data point – it is very useful to me since I design computers for children. Basic was my first high level language (after programmable calculators and 8080 assembly) and I did some serious stuff in it, so I am aware of how far it can go. When I started creating children’s computers in 1983 I based it on Logo but I switched to Smalltalk the following year and am still using that.
I watched two video about Idle and while it gets the job done it is very primitive. And Blocky is nice but it seems to be a separate language that then gets translated to Python (or Javascript or Dart) so it isn’t really what I had in mind. I wanted an actual graphical editor for Python which would give a smooth transition from Scratch to something like Idle as experienced users started to type more and more and drag-n-drop less.
Stewart Watkiss
Jecel – Perhaps better as a forum discussion. If you’d like to start a thread or if there is one already let me know and I’d be happy to contribute to the discussion further.
A graphical editor could well make the transition to Python a lot easier. I don’t think it needs to be complete code blocks like Scratch / Blocky, but something that makes choosing appropriate statements and syntax would be great.
Most of the ones now becoming available appear to be web based, but they can’t interface directly with the computer (GPIO etc). I think there is a place for a traditional editor / IDE that could make programming a traditional programming language easier.
Karl Herrick
And I just got the original running natively on the Adafruit 320×240 2.8″ TFT+Touchscreen. ;-)
http://karlherrick.com/dev/2014/04/28/2048-touch-enabled-raspberry-pi/.
M5L
Oh no! I’m mentally mutilated beyond hope of regeneration!
Noah Rosamilia
Is there any way to run Eben’s port of 2048 on the Raspberry Pi using RISC OS Pico?
mob-i-l
I uploaded some BASIC-programs for ZX81 and ABC80 to Github: github.com/mobluse.
ColinD
10 GOTO comment 2
Bryan Hogan
I find it funny that the whole of RISC OS is smaller than the Pi boot loader!
AndyD
I had never seen 2048 until this post. Thanks now I am addicted. Does anyone have a video of Eben’s Basic V version of 2048?
John Read
I have just tried running Ebens excellent BBC version of 2048 (which runs fine on Beebem on my PC) on a BBC model B by saving the disc image on an MMC card in the Beeb. Initially gives an out of memory error at line 80, so will have a look at Ebens code and see if I can spot what’s going on. Anyone else tried this?
Eben Upton
Hmm. What’s PAGE on your machine? And which version of BASIC? It’s a *very* tight fit (a few tens of bytes), so it’s conceivable even small configuration changes will push you over the edge.
John read
Thanks Eben,
Had just solved it prior to reading your post by lowering page from &1900 to &1100. Now works great. Process has reminded me of much of my late teens spent fiddling about to cram things to fit in that 32k, particularly after getting DFS that lifted page from &E00 to &1900 !
Comments are closed