Wednesday, September 30, 2009

Clojure

Clojure is an incredible achievement.

I've been using it for three weeks now, and as far as I'm concerned it's the new lisp that we've been promised for so long, only much better. Lisp as McCarthy, Steele, and Sussman would have done it if they'd had the computers and the perspective we have.

A lisp where vectors and sets and maps are as important and as usable and behave in the same way as lists, and in fact where if you're not concerned about speed you actually may not be able to remember
which you're using.

A lisp where the code looks like python with brackets.

As well as that, it has a whole new paradigm for concurrency, which I've started to play with but wouldn't claim to understand, but which looks really good.

The third big feature is its interoperability with Java, and the huge libraries that this brings along for free.

At the moment, you can keep all that. Last time I tried to use a Java library from Java itself, for xml parsing, I gave up in disgust and went and rewrote my program in python because learning how python does it, and rewriting the whole program, was easier than learning how Java does it.

But I am told that this is a common reaction from people coming at clojure from lisp-y directions, and that actually after a few months, they regard it as a major strength.

And I have a friend who is a programmer doing an in-house system, who already has a great heap of Java to work with, who has taken up clojure entirely because it's a much easier way to write Java, and who doesn't really get the whole macros and code-is-data and functional programming thing yet.

And we have him now....

Well done Rich Hickey!

No comments:

Post a Comment

Followers