Wednesday, October 15, 2008

[Programming] Trying Clojure

Clojure is a new Lisp dialect created by Rich Hickey.

It is interesting to me because it runs on JVM with a large collection of Java libraries directly available to Clojure and keeps most of the best features of Lisp.

While Common Lisp supports functional programming, it supports other paradigms of programming quite well. Clojure only supports functional programming. It does not support object-oriented programming in the style of Common Lisp or Java. So it will be challenging to learn.

Its software transactional memory and immutable data structures make Clojure very powerful in concurrent programming.

You can find links at the official homepage to the tarballs, subversion repository, IRC channel and newsgroup. Besides the official homepage, the Clojure wikibook is also very helpful.

Clojure is under fast development and most users are using its subversion repository directly. Slime integration is a must if you are comfortable at using GNU Emacs. You should also be familiar with the Java library or have the API available to you, as Clojure depends on the Java platform for many functionalities.

The traditional REPL environment is a bliss to development and debug, but the error messages certainly need a lot of improvement to be helpful. You also need knowledge of the JAVA API and even Clojure implementation details to decipher such messages.