in which cards are stacked

My childhood summers involved many days spent building out expansive HyperCard stacks to explore in a game world that spanned across cities and islands and galaxies, littered with creatively absurd death scenes to keep you on your toes. The instant accessibility of HyperCard invited you to explore and create without feeling intimidated. Especially for younger minds, I believe there's something fundamental about the spatial aspect of HyperCard. Every button has its place, and rather than creating an abstract hierarchy of classes or a mesh of interconnected modules, you can see that buttons have a specific place on a card, which exist "inside" a stack in a metaphor that maps to the way we already perceive the world.

you know, for kids

While Apple killed HyperCard off many years ago, there exist tools for children today that maintain this accessible spatial arrangement. I've written before about how my kids love playing with Scratch, a Logo-descendant providing colorful sprites and drag-and-drop scripts to animate them. While this is unbeatable for the early years, (especially for kids who are only just beginning to learn to read) eventually you hit an abstraction ceiling beyond which it becomes very tedious to express your ideas due to its non-textual nature. There are modern HyperCard clones like LiveCode, which offers a very sophisticated platform, but falls prey to the same tragic pitfall of attempting to build an "English-like" programming language, an endeavour which has been attempted many times but always ends in tears.

myst island

So as I've thought a good next step for my own children, we happened to start playing the game Myst. Given my children's proclivities, this was immediately followed by Myst copycat worlds drawn out in elaborate detail with pen and paper the next day. I thought of what I could do to bring back the exploration and creativity of HyperCard, and eventually I got to building my own implementation.

The natural choice for this project was definitely the Racket language. While I'm much more familiar with Clojure, it's a very poor fit for a first-time programmer, especially at a young age. Racket boasts lots of great learning material, but beyond the texts there's just an ever-present focus on usability and clarity that shines through in all aspects of the language and community.

drracket error

Racket's roots lie with the famously-minimalistic Scheme, but it's grown to be a much more practical, expansive programming language. While there are still a few places in which its imperative roots show through, it has good support for functional programming and encourages good functional practice by default for the most part. (I hope to do a future post on a few ways to improve on its FP, both via the Rackjure library and some of my own hacks.) But what really sets Racket apart is its solid tooling and libraries. I wouldn't put my kids down in front of Emacs, but Racket ships with a very respectable IDE that's capable and helpful without being overwhelming. The GUI and drawing libraries that come with Racket have proven to be very useful and approachable for what I've done so far.

So far Cooper, my HyperCard clone, is fairly simplistic. But in just over 500 lines of code, I have a system that supports manipulating stacks of cards, drawing backgrounds on them, and laying out buttons which can either navigate to other cards or invoke arbitrary functions.

It's not sophisticated, but my children have already shown plenty of interest in using it to build out small worlds of their own in the cards. They've so far been willing to put up with lots of glitches and poor performance to bring their imaginations to life, and I'm hoping that this can gradually grow into a deeper understanding of how to think in a logical, structured way.

Update: I'm not working on this any more, but I have another project which takes a different approach towards teaching programming. However, for approachable, kid-friendly storytelling-type programming I would strongly recommend Twine.

« older | 2014-10-07T22:25:46Z | newer »