TinyBASIC for Raspberry Pi

A large number of engineering professionals are using the Raspberry Pi to explain to their kids what it is they do at work. When we’ve met these families, the enthusiasm positively dripping off everybody has been extraordinary. But we’ve also had a really surprising number of emails from parents who haven’t done any programming since school, but who still have books on BASIC from when they were kids, remember enjoying computing lessons, and want to share some of what they used to do with their kids. It’s actually a great way to get kids started, especially if you have some enthusiasm of your own to share: enthusiasm’s contagious.

The good news for those people, and for anyone else who wants to learn BASIC from scratch or revisit an old friend, is that TinyBASIC is now available for the Raspberry Pi. Andrew Lack has ported this very lightweight editor, interpreter and graphics package to the Pi, and we think it’s great.

Before I go any further, I want to pre-empt any “But BASIC is not an object oriented language and will therefore ruin the tiny, plastic minds of our children, who will be forever unable to understand structured programming. And GOTO is for clowns,” comments here by saying that learning BASIC as kids doesn’t seem to have held any of our developers back; and that if you really hate GOTO you can actually disable it in TinyBASIC. As Andrew says:

One of its unique features is the provision of flavours which allows the beginner to taste programming with vanilla which has the simple—but unsatisfactory—GOTO statement, then make the switch to sweeter raspberry and learn the joys of structured programming where GOTO is banned!

A download, sample code and documentation are all available here. There are a few very cute samples available: we thought drawing a Union Flag and calculating Pi seemed curiously apposite.

Flag, code

Flag output, and the BASIC you need to draw it. Click to visit example code page.

We’re considering bundling TinyBASIC as part of the standard Raspbian image once we’ve done some work on how popular it turns out to be (after all, it’s not as if it’s going to be taking up scads of space on your SD card; the .deb distribution file is only 66k): let us know what you think in the comments.

120 Comments