Scheming on the way to Oz

Posted on

I arrived in Australia 2 days ago to sort out various passport related issues and to get some time in the office(it's been 6 months). Since the flight gave me a spare 24 hours to fill I decided it would be an excellent time to start learning Scheme. This is something I've been meaning to do for ages, just to stretch my programming mind in new ways, but also because I'm just curious about Scheme/Lisp.

Before I left I installed the Fred Bayer's excellent LispMe Scheme interpreter on my Palm. This is a relatively complete, almost standard, Scheme implementation which includes APIs for Palm graphics, databases and UI elements. Not that I got that far ... I'm definitely closer to the "Hello world" end of the spectrum when it comes to Scheme.

For documentation I downloaded Dorai Sitaram's excellent free tutorial Teach Yourself Scheme in Fixnum Days on to my Palm. It's freely available in HTML, a page per chapter. A bit of fiddling with Pyrite Publisher gave me a suprisingly readable Palm version, one document per chapter. The output wasn't perfect but completely useable. Given a little more preprocessing I reckon I could get the whole tutorial into one document.

Although I would have loved to, I didn't get the classic Scheme/Lisp text Structure and Interpretation of Computer Programs onto my Palm. It's damn big and I couldn't figure out a way to convert it nicely in the time I had to do it. I think it is doable though.

By setting up shortcuts in the Palm launcher I was able to quickly switch between the book and LispMe and happily spend the much of the flight(s) teaching myself the basics of Scheme. Some thoughts:

  • LispMe is cool! There wasn't anything that I covered in the tutorial that it couldn't do. Some of the demos programs are really impressive too, for example a 3D rotating cube!
  • Teach Yourself Scheme in Fixnum Days is a nice tutorial. It doesn't mess around much and gets into more difficult ground fairly quickly. It's probably a good introduction for programmers experienced in other languages.
  • I'd still like to go through SICP at some stage to get a more complete grounding in Scheme.
  • Entering Lisp-like code via the Palm graffiti input system requires a certain amount of dedication. There is a Palm hack that comes with LispMe to help with parentheses matching but unfortunately it doesn't work on more recent Palm's like my Tungsten.
  • I don't think I could see myself using Scheme for any major projects, not when I already find Python to be such a good fit for most things. That isn't really the point of this exercise though (and I should never say never).

I have a lot more to learn. I certainly didn't get through the whole tutorial but skipped ahead a bit to see what other stuff is covered. Continuations, the non-deterministic operator (amb) and macros look really interesting. The brain stretching really begins when you start getting on to these more advanced topics. Maybe for the flight back to the UK...