?

Log in

No account? Create an account

fanf

Computers for children

« previous entry | next entry »
30th Sep 2007 | 21:28

I've been thinking about teaching children to program (or helping them to learn), especially since it came up in conversation at a recent party. (This is slightly inspired by my son, but he's only a year old so he won't be getting to grips with computers for some years yet.) The discussion at the party was based on our experience of starting with 1980s micros, which we think was a good way to learn programming, so how could we provide something similar to the children of today? I think this kind of micro must be:

* safe for playing with minimal supervision
* very simple (or apparently so)
* good for fun as well as for programming

More detailed requirements are a consequence of the above:

* The hardware has to be robust, so no moving parts. The drivers have to be robust too, so you can yank the power or plug/unplug peripherals without bad consequences.
* As cheap as possible, so it doesn't matter if it dies from abuse. This implies it should be off-the-shelf, and able to use standard peripherals, e.g. hand-me-down display etc.
* No high-level networking. Low level features are useful for older children to learn network programming, but for most usage it'll have an air gap for safety.
* No complicated user interface. It'll run one full-screen task at a time, such as a game or a programmer's read/eval/print loop.
* Easy to do fun things with graphics, sounds, and robotics.

I think the right solution is to use a "thin client": one of those computers that's designed to provide a keyboard and display to a remote server. You can get plausible ones for about £100. However, instead of booting off the net, it must be able to boot off flash (built-in or USB). At the moment a couple of good options are the TinyTuxBox 4 or the Linutop, both based on the same AMD Geode CPU, though the latter has the advantage of using LinuxBIOS.

It might not be easy or sensible to reflash the BIOS so that these computers can boot straight into BASIC for that authentic 1980s experience, so it's probably best to use USB flash drives as if they were Atari or Nintendo cartridges. Then it should be easy to ship software as disk images - with perhaps collections of games for fun as well as a programming language.

I'm not actually keen on BASIC as a language or environment. Its only surviving descendent is Visual BASIC which is too complicated, volatile, and proprietary for my purposes, and I don't see any advantage in resurrecting an older variant. Logo has plenty of teaching materials, which is handy, and it's a reasonably nice language with a fair amount of power. Or maybe Lua - though perhaps that only seems simple to people who already know how to program. I think it's also worth providing a text editor for programming, not just a command prompt, since we aren't constrained by memory in the way the eight-bits were, and the children will already have some familiarity with word processors.

Under the simple language and simple editor, it is unfortunately difficult to remain simple without expending a great deal of effort. It's a challenge just to get a modern CPU to run without toasting itself to a cinder. On the x86 platform you have 25 years of accumulated expedient hacks to work around in software. Doing general-purpose IO over USB is just a bit more complicated than a latch wired to your data bus. Given all that it seems that the most sensible plan is to start with a Linux or BSD kernel, and put a simplified userland on top.

It's difficult to choose how to support the key features - graphics for example. X11 is not simple, but it is very well supported and it's easy to make it look simple (if you throw away the display manager and window manager etc.) On the other hand it ought to be simple to build on top of the framebuffer device, but then (since I don't want to re-invent many wheels) I'd still end up pulling in layers of complexity (DirectFB and associated libraries) some of which are explicitly experimental and incomplete. But since it's all sitting on a Unix kernel I suppose I've already given up the idea of making its innards easily comprehensible.

Another example of the appearance of simplicity despite enormous amounts of hidden complexity has to be robotics. Phidgets look like fun hardware interfaces, but of course they depend on USB so they only appear to be simple...

Before signing off I should note that the OLPC XO is not what I'm after. It has more user interface and more networking than I want. I don't want a general-purpose computer, I want a programmable toy.

| Leave a comment | Share

Comments {44}

from: kaet
date: 30th Sep 2007 22:31 (UTC)

I think that Lua well may be worth thinking about. It reminds me of being the new (clean) PHP, and that's something which non-programmers took to very easily. When I think of the books I learnt from, they had chapters on conditionals, loops, arrays, and so on, and that seems to be easily doable for Lua. What it lacks, though, is a rich, appealing IO layer. Like mode seven on the beeb, and all the stuff you can do with the C0 controls. I think you need a thick library without too much abstraction, so that you can get brightly coloured things on the screen, and annoying noises out of the speaker, quickly.

Aren't you missing a trick, here, though? It's now so easy, again, to build computers, just like it was in the early days! And the possibility of a machine with an open "ROM" and hardware, how wonderful that would be!

Reply | Thread

Tony Finch

from: fanf
date: 30th Sep 2007 22:48 (UTC)

I think whatever language I pick I'd have to spend some time plugging it in to a graphics library (e.g. Cairo), sound, etc. I wonder if it's worth plugging in a terminal emulator so you could type somthing like VDU 27,91,51,49,109 to get red text. (An evil way to do this would be to run in xterm and use the WINDOWID environment variable to draw graphics in xterm's window, like w3m.)

I don't want to make a computer from scratch because it would not be sufficiently robust or cheap. Something based on off-the-shelf hardware is more likely to be of use to other people.

Reply | Parent | Thread | Expand

- ewx - Expand

Gerald the cuddly duck

from: gerald_duck
date: 30th Sep 2007 22:41 (UTC)

Logo is a language eight year olds can be taught very comfortably. Smart children would probably be entirely happy with it sooner, and I've personally managed to teach fairly bright nine year olds rudimentary recursion in half an hour using Logo before now.

Why not an OLPC XO? It has more things than you want, but surely that's much better than fewer, given you can fairly easily disable stuff? It's also cheap and rugged.

Another possibility might be Lego Mindstorms? Or an old BBC micro with the Logo ROM inserted higher than BASIC?

How easy would LISP be to learn? It goes against the grain of a lot of more recent syntax, but that's not necessarily a problem if it's the first language someone encounters.

Or you could try Alligator Eggs, though it feels a bit contrived to me, and not actually as easy to understand as lambda calculus.

Reply | Thread

Tony Finch

from: fanf
date: 30th Sep 2007 22:58 (UTC)

It seems a bit of a shame to get an OLPC XO and then lobotomise it. They're also more expensive than thin client hardware, given the buy-two-get-one donation model.

Lego Mindstorms makes a plausible peripheral, but it's a satellite to a bigger computer. A good alternative to the Phidgets, I think.

An old BBC doesn't have any sensible storage options.

Lisp is just Logo with more (). Alligator Eggs is a game, not a programming language.

Reply | Parent | Thread | Expand

Simon Tatham

from: simont
date: 30th Sep 2007 22:51 (UTC)

I think it's also worth providing a text editor for programming, not just a command prompt

And conversely, I think it's definitely worth providing a command prompt, not just a text editor!

The thing I always thought was really good about BASIC was the interactive command-by-command mode, which enabled lots of hands-on playing with the capabilities of the system before you started organising your commands into list form. Lots of round-trips during one's interaction with the machine allow you to get lots of information: typing in a twenty-line program, hitting Run and getting a single piece of information back about whether it worked or not isn't nearly as illuminating as trying several of those lines one at a time in rapid succession and then stitching them together into a program.

So this was a big plus point of BASIC as a teaching language over, say, Pascal; if it were me choosing a teaching language now I'd probably make that a major criterion in my choice.

Reply | Thread

Tony Finch

from: fanf
date: 30th Sep 2007 23:16 (UTC)

Indeed! Logo and Lua also have command prompts.

The BBC Master had a text editor in ROM. You could switch from the command prompt to the editor with *EDIT, and it would present you with the current program to mangle as you wished, and it would be re-tokenized by BASIC when you exited. I'd like to have something like this, though I'm not sure how it would work in a modular language like Lua, or a working-image language like Logo.

Reply | Parent | Thread

HairyEars

from: hairyears
date: 30th Sep 2007 23:03 (UTC)

Maybe Pascal is the place to start, although Object Pascal isn't all that good a progression to more modern programming practice.

An interesting question: what would you use to teach someone programming?

Reply | Thread

Tony Finch

from: fanf
date: 30th Sep 2007 23:22 (UTC)

Not Pascal, because it's too static, both in terms of its edit/compile/run/crash cycle and itsstring and array semantics. As I said above, Logo or perhaps Lua seem like good choices. Both are quite simple (though still powerful), dynamic, interactive. Do you prefer functional or imperative? (Though Logo is dynamically scoped so isn't properly functional.)

Reply | Parent | Thread | Expand

(Deleted comment)

Tony Finch

from: fanf
date: 1st Oct 2007 08:00 (UTC)

Thanks for the link!

Reply | Parent | Thread

Pete

from: pjc50
date: 1st Oct 2007 07:58 (UTC)

Various people I know have been looking at this: Alastair Turnbull + Tom Lynn (Nifki: web-embedded simple dev environment) and Eben Upton (the "sub $10 computer": basically an ATMEL with a video out and Lua ROM)

Reply | Thread

Pete

from: pjc50
date: 1st Oct 2007 07:59 (UTC)

Actually, why not a real BBC master?

Reply | Parent | Thread | Expand

Andrew

from: nonameyet
date: 1st Oct 2007 09:12 (UTC)

The hardware has to be robust, so no moving parts
Which aspects of programming are you thinking of teaching ? What age child ?

I would have thought that children would learn from programmable robots earlier than a keyboard/mouse/screen computer.

As well as LEGO mind-storm, I'm thinking of the Logo Turtle and perhaps Big Trak (though it was probably too expensive). Did you know that programmable robots go back at least to the ancients Greeks (see New Scientist, 04 July 2007, issue 2611 "The programmable robot of ancient Greece" - http://technology.newscientist.com/channel/tech/mg19526111.600-the-programmable-robot-of-ancient-greece.html
if you have access) ?

Reply | Thread

Tony Finch

from: fanf
date: 1st Oct 2007 09:36 (UTC)

The idea is for it to be the first general-purpose programming language. Good idea that something like a Big Trak would be a good toy to precede this one. (You can indeed use Mindstorms in that way as well as hung off a computer.) As for age range, starting from as soon as they have enough literacy and numeracy - 8 is a commonly-cited starting age. Before programming, a simplified computer like this would be good for running games and puzzles and tutorial software. It might even be useful at pre-school age for helping to learn letters and numbers - though books are better :-)

Reply | Parent | Thread | Expand

cvrt

from: covertmusic
date: 1st Oct 2007 10:16 (UTC)

Squeak?

Reply | Thread

Tony Finch

from: fanf
date: 1st Oct 2007 12:18 (UTC)

TBH, I'm not a great believer in OO or graphical programming. Squeak strikes me as too complicated and unrealistically twee. But I'm willing to try it out on real kids :-)

Reply | Parent | Thread | Expand

Sheep with a guitar

from: sbp
date: 1st Oct 2007 11:29 (UTC)

Pity the Sharp Zaurus series of machines isn't more widespread. They run Linux but the OS is flashable. You could use the CF slot as a pseudo-cartridge/ROM slot, they have a serial port, some have USB hosts, and some are clamshell-design. They'd probably be good for small fingers too.

Or you build on top of a portable gaming platform that kids are already using or might want to use for gaming, so they wouldn't have to buy extra hardware.

Reply | Thread

Tony Finch

from: fanf
date: 1st Oct 2007 12:05 (UTC)

Yeah, that kind of hardware is worth keeping in mind, though for my purposes you have to be able to plug in a keyboard (even via Bluetooth, at a push). The simplified Linux userland strategy has the advantage of being pretty portable, unlike something that aims for low-level simplicity...

Reply | Parent | Thread

from: kaet
date: 1st Oct 2007 11:39 (UTC)

I think it's worth concentrating on architecture-irrelevant and (to an expert) superficial aspects that could really affect adoption. For example,


  • I think it would make sense to reduce the modularisation at some sacrifice of namespace integrity to not include abstract concepts not understood initially. (Eg no System. or OS. at the start of names; sound.play is okay, but System.io.print is bad). Blurring the distinction between programming-fundemental ideas like flow control and IO nonsense like sounds and the like is probably a good thing, initially.
  • Minimal amount of typing necessary for the simple programs, taking into account things kids will want to do initially. No module headers, declarations, etc, needed before you can say "print 'hello world'".
  • Making it easy to do amusing stupid things, daft noises, bright colours etc. Including silly dances in sets of robot movement primitives, etc.
  • Tailoring defaults, and other niches where an arbitrary choice is to be made, to things which key in with developmental factors. For example, having high-bit character spaces occupied by sprite characters which are easily narrative (dragons, spaceships, etc), easy sprite manipulation, etc.
  • Focusing on "emulating" (in the experience sense) simple machines which currently have a high status, eg the Nintendo DS. Simple, silly, games (like platformers) are still popular on those machines.
  • etc


I think this kind of stuff might be good (for someone) to focus on from the start. Also, it might be worth talking to 1ngi about this kind of thing, as she's probably got very relevant skills.

Reply | Thread

Tony Finch

from: fanf
date: 1st Oct 2007 12:08 (UTC)

Thanks for that - all very good suggestions.

Reply | Parent | Thread

cartesiandaemon

from: cartesiandaemon
date: 1st Oct 2007 12:28 (UTC)

I just came across lua recently. It seemed very easy to get up to speed with. Eg. has a good mix of types and casting.

But object variables are by default *references* which is quite elegant, but possibly confusing when you're first introduced to them...

Reply | Thread

from: kaet
date: 1st Oct 2007 14:00 (UTC)

I'd initially go for the TinyTuxBox, because it seems neater, because of its internal drive. The Linutop, with slightly its weird pen drive sticking out is fine for an industrial setting (though in the photo they had to build a perspex enclosure to keep it dust-free), but looks weird at home. I think having something that looks like "something you might buy" might help, even if it's not actually something that you're going to sell!

On the other hand, that's a minor point technically. I wonder if you can have an internal USB port on the Linutop?

I think pen drives are ideal as a modern storage mechanism. Kids often like dinky stuff like that.

Reply | Thread

cvrt

from: covertmusic
date: 1st Oct 2007 16:16 (UTC)

Oh, another couple of thoughts, mostly for possible inspiration: Nodebox and Processing.

I'm a big fan, and have made real use, of both.

Reply | Thread

gareth_rees

from: gareth_rees
date: 4th Oct 2007 09:49 (UTC)

I'm not sure it's worth worrying as much as this. If children are interested in programming, they will grab whatever opportunities they can get with both hands. (I wrote my first programs on an HP-15C, and I wrote my next ones on paper after reading Illustrating Basic by Donald Alcock, since I had no computer to try them out on.) If they're not interested, then no environment will make them, and hunting for a setup that's "just right" will only lead to disappointment.

I also think your worry about Basic is misplaced. Someone who has aptitude for programming will have no trouble moving on to other languages; someone who gets hung up on the very minor differences between one programming language and another is going to have a lot of other difficulties.

By the way, I think Blitz Basic has a lot going for it. It's easy to draw stuff on the screen and it has 3d graphics built in. I would have loved it as a kid.

Reply | Thread