Scheme is love
Sep 19th, 2006 by Phil Dawes
I’ve been battling again with Scheme recently.
Having spent the last couple of months playing with various languages, I’ve come to the conclusion that scheme is the only one that has any real possibility of becoming my next ‘general purpose language’. Python held that crown for many years, but its lack of blocks and concurrency caused me to start looking elsewhere and now I’m spoilt.
So, to Scheme. I’ve not found another language that can offer:
- functional programming
- message-passing concurrency (see termite)
- macros
- continuations
- terse syntax
- hardly any language cludges
…and as somebody who programs for fun in his spare time, these things really do matter to me. The biggest obstacle to full enlightment is the s-expression aesthetic: To my algol-shaped brain that lisp syntax just looks so damn ugly!
Anyway, I’m finding that the most enjoyable and self-affirming way to develop some scheme skills is (ironically) to re-read Peter Seibel’s ‘Practical Common Lisp‘ book with scheme glasses on. Now if there’s anyone going to convince me that lisp syntax isn’t just a grotty heap of parentheses, it’s going to be Peter. His book just radiates lisp-love, and you can’t help but be hooked. It says ‘Look! You fools! Just look what you’re missing!’. I’ve been translating various examples into scheme, just to test the water.

Which implementation of Scheme? Gambit has Termite, but lacks a good standard library, whereas Chicken is the other way around.
It’s having to make decisions like these that make me nervous about learning a new language, and long for good old safe-but-boring Java. At least there’s only one (for now).
Yep, I’ve done the Gambit… no Chicken!.. no Gambit!… etc.. shuffle.
I’ve settled on gambit for the moment because of termite. I’m hoping that the new library system in the upcoming r6rs standard will lead to more portable set of libraries and make the choice less all-or-nothing.
Re learning a new language: I think you’re right to be nervous. The biggest problem is the Red Pill-ness of it all. Once you’ve hit upon a feature you like, especially one which gives a big productivity boost, going back to your old language is pretty depressing. I remember in the late nineties witnessing a bunch of jaded smalltalkers hit the java market - they had this constant ‘things will never be the same’ look about them.
Maybe you should take a closer look at Scala?
http://scala.epfl.ch/
Not only has it all you can expect from a modern programming language (functional and OO-programming, an exceptionally good type-system which is statically but does not stand in the way, providing type inference, generators, sequence comprehensions), it also provides the ultimate answer to the old singel vs. multiple inheritence discussion: Traits.
And it has the additional bonus of running on a JAVA JVM, but you can also run it on .NET:
http://scala.epfl.ch/docu/clr/index.html
You will find a promising chapter “Abstractions for Concurrency” in “Programming in Scala”:
http://scala.epfl.ch/docu/files/ProgrammingInScala.pdf
Cool - I’ll check it out. Thanks