Skip to content

KidsRuby running on the Raspberry Pi

Thursday, 22 September 2011  |  richard dale

I've been following the development of the Raspberry Pi computer, which is a small ARM based device costing only 25-30 euros. It is designed to plug into TVs, and is targeted at teaching kids to learn programming. I was excited to read today that the KidsRuby programming environment is running on a Raspberry Pi. You can read some of Liz's other blogs for more details about the Raspberry Pi's progress.

That is a subject which is dear to my heart. I don't personally have any kids, but I'm very interested in how they learn programming and how young they can get started. I came to Gran Canaria six years ago to help Agustin Benito put KUbuntu based computers into all the Canarian schools, and to learn Ruby On Rails programming at a great company called 'Foton'. That seemed the perfect combination to me.

I first learned programming when I was 19. I was studying for a degree called 'Philosophy with Cognitive Studies', and we were taught to program by people who were very interested in how people learned to program. The course taught us about 'constructivist' educational theories by Jean Piaget, Symour Papert and so on. The idea is that you learn by doing things. A computer turtle that you can program to move round the floor, or wooden blocks that you assemble into patterns to discover about maths and geometry are the perfect tools for the constructivist approach. This is instead of sitting there in class passively while a teacher stuffs your head with facts, and then at the end of the year you have a massive load of exams to test whether you have learned the facts correctly. Sadly dumb fact learning of a 'national curiculum' and SATS tests are now the norm in 'politician driven' educational systems as in the UK or the USA. Instead of a glorious constructivist future made possible by the learning augmentation features of personal computers that people dreamed of in the 1960s and 1970s, we've ended up with a boring 19th century style dead end to education.

The cognitive studies students were the first guinea pigs for a new way of teaching programming by using the POP-11 language interactively via teletypes in a Unix environment. It seems a bit strange today to think of a teletype as an advanced device, but in the mid-1970s video terminals were still really expensive and most students learned programming using punched cards that they submitted to a central facility. I had gone to some engineering lectures about FORTRAN before I switched to Philosophy, and because it used punched cards the whole subject seemed about the dullest thing you could imagine. But using a teletype interactively to work though self taught assignments was a different thing altogether. You could type a line of code into the computer, hit return and it did something.

In the early 1980s cheap computers running BASIC became widely available. But because I am a bit of a programming snob, I wasn't very interested in BASIC as it seemed like warmed over FORTRAN (it was) to me. I still wanted my own computer but none of them had much appeal. Even though these machines weren't for me, it did mean in the 1980s that many people got started in programming with their Sinclairs, Commadore 64s, BBC Micros and so on. It was a golden age of programming in schools. Once those machines were replaced by Windows machines in schools in the 1990s, those programming environments weren't available. Instead of teaching themselves BASIC, kids would learn about Microsoft Word instead, and that is very sad. Instead of finding about about the fun world of programming, they were learning how to be an Office drone. I once showed my nieces what 'hello world' looked like in QtRuby. They were about 15 and 17 years old and still at school at the time, but neither of them had ever seen a computer program before. They did say that it looked quite english-like and they could work out what it was doing.

After learning programming at University and getting my first programming job, the next big jump in my programming education came when I was 27, and I bought one of the first Apple Macintoshs. I ran MacPascal on it and taught myself Pascal using a book called 'Oh! Pascal' which I think is a classic. After learning Pascal I was able to get myself a programming job as a Pascal programming. That became a pattern for the rest of my career. I bought a NeXT computer, learned Objective-C and then became a professional Objective-C programmer. More recently I learned Ruby by writing the QtRuby bindings on a MacBook and then became a Rails programmer.

Once I had my own computers and my chosen programming environments to learn about, I was able to set the direction of my career. That probably seems fairly normal today, but I don't think it was how most programmers of my age progressed in their careers. Normally you would rely on your current employer to send you on programming courses. Over the years thanks to the generosity of your employer you were able to progress from being a COBOL-74 programmer to a COBOL-85 programmer who also knew RPG. Exciting stuff!

So there is a massive difference between having your own computer that you can program, as opposed to having to borrow someone else's machine before you can learn anything new. This is not only a problem for grown ups like myself, but it is a problem if you are about 9 years old and want to start programming. Your parents probably have a Windows machine that doesn't have any built in programming environment, and even if it did they might not be very happy to let a young kid loose on it. This is where the Raspberry Pi comes in. It is cheap enough for every kid to buy, and they can do what they like with it as it doesn't matter if they fill up the file system with logging messages when their program loops, or how many viruses they accidently download as it doesn't run viruses.

In the blog about KidsRuby running on the Raspberry Pi there is a link to a talk by Ron Evans that he gave at the Golden Gate Ruby Conference 2011 called KidsRuby: Think of the Children. I would have been very interested in the talk anyway, but what made my day is that the KidsRuby application is written in QtRuby, and it even gets a mention in one of the slides!

It made me think I really must try and get QtRuby 3.0 moving again. We had a mini-BOF at the Berlin Desktop Summit where 5 of us got together and then Arno ran through a description of the basics of how Smoke worked, followed by me running through the QtRuby 3.0 code. It is designed to be much easier to follow than the QtRuby 2.x code, and so that the 'bus factor' is increased. If I happen to drink 15 pints of beer one evening and fall off a balcony then it might be the end for me, but at least there would be some chance that others would be able to carry on maintaining QtRuby. It will also be more modular and instead of always loading all the Qt libraries, it will only load the ones you want. That should help memory constrained devices like the Raspberry Pi. I also need to make sure that QtRuby can be built as gems on all platforms right from the start. Ron Evans said in his talk that packaging KidsRuby was one of the trickiest aspects of the project. He sometimes asks questions as 'deadprogram' on the #qtruby irc channel about packaging issues, but I don't think I've personally given it the priority it deserves. Ryan Melt has done a great job with the qtbindings project on github where you can get cross platform gems, but I must try and structure QtRuby 3.0 to make it easy to build gems from the start.