Exploring Clojure (Lisp on the JVM) - Part 1
Wednesday, October 22, 2008
As I was driving Hans Hübner to the airport after the
September lispvan meeting, we chatted a bit about different
concurrent Lisp options. We had both
tried out Erlang, but would both prefer to use something that is more
"lispy" if possible. We discussed
LFE, Lisp Flavoured Erlang, (which is a lisp syntax front-end to
the Erlang compiler) and
Clojure (a new lisp that runs on the JVM) as potential options. A few weeks later, I
was pleased to see that Hans had
tried out Clojure. I had been meaning to have a look at Clojure for a
while, and his post gave me a bit of a push to actually spend some
time with it - thanks Hans!
Clojure is the brainchild of Rich Hickey and comes after he tried a number of different Lisp/Java interoperability approaches. A few years back, I wrote a series of blog posts on Lisp/Java interoperability (see here, here, here, here) that outlined different approaches that people were trying. At the time, I also blogged about some Lisp/Java interoperability alternatives that Rich Hickey had developed. However, Rich's early approaches to the problem were focused on achieving interoperability between code running on a Common Lisp implementation and code running on a Java VM. With Clojure, Rich has taken a different approach and has developed his own Lisp dialect that runs directly on the JVM. In addition to being more seamlessly interoperable with Java code, his Lisp is designed for concurrent programming. Since concurrent programming is also a topic that I've dealt with a lot in my blog (see here for some links), and I used to be very interested in Lisp/Java interoperability, Clojure has a definite appeal. A number of people have created their own Lisp dialects (some which have also run on the JVM) without ever gaining any significant user base (aside from the creator); however, Rich has a well thought-out rationale for his design decisions and the number of people using Clojure seems to be rapidly expanding, which might allow Clojure to "take off" while other new Lisp dialects have not. If the buzz from the September Boston Lisp meeting, the JVM Language Summit, and OOPSLA is anything to go by, it looks like Clojure is generating a lot of interest! I particularly liked the following comment on the OOPSLA Clojure talk:
"Rich Hickey presented his programming language, Clojure. This was the talk of the day. Clojure is a Lisp dialect that runs on the JVM. It's got a growing community, a lot of innovation, and a buzz of excitement. It looks fantastic from the presentation and I can't wait to try it out. On top of that, the older Lispers seemed excited. The torch was passed. The presentation was well-timed. The whole day seemed to lead to the idea that innovation was important, Common Lisp was a political compromise and not a technical ideal, and that something needs to be done. Then came Clojure.""The torch was passed" - hehe, nice.
I'll probably be doing a few posts on Clojure as I play around with it and comment on my experiences, so this post is "Part 1".