Bookmark and Share

Beginning Clojure

What would be a better way to start the autumn season than learning a new programming language?

Like most earthlings, I have been programming using the imperative paradigm exclusively: C, C++, Java, MATLAB, procedural/OO Python, PHP, whatever. With or without objects, with static or dynamic typing, the fundamental idea is always the same, derived from how the processor works under the hood: the execution flows from one statement to next and the program’s state changes accordingly. The programmer’s job is to form the statements and flow such that the state changes represent something meaningful. An opposite approach is declarative programming, where the programmer’s job is, curiously enough, to describe what the program should accomplish, rather than how to accomplish something. This sounds like total black magic, so I definitely had to find out what it is about.

I did some research and found two hot modern languages that run on the JVM and include functional features. The newer one, Clojure, is barely two years old. I was also considering Scala, but after some research I couldn’t convince myself that it were more than “somewhat improved Java” (Or degraded? See this article, this comment and these complexity comparisons between Scala and Clojure: 1, 2). Add to the top that I was looking for something completely different, so Clojure was a clear choice. (Disclaimer: of course I’m unable to compare the quality or usefulness of the two languages when I haven’t yet learned nor used either of them. Please don’t accuse me of making an unfair choice. What I write here is based on my first impressions, and no one can deny them.)

So I purchased my copy of Programming Clojure and installed the necessary tools to start trying it out. The principal IDE, Enclojure, is actually a plugin for the NetBeans IDE, which is par excellent choice (as is Clojure’s choice to run on the JVM). I doubt there has ever been any other programming language with this fine overall environment ready at this early stage — mere two years after its first publication. It does make a difference. Give me the finest language in the world with weak tools, and I’m not interested. From the viewpoint of a real-world programmer, a programming language is never a separate entity. It’s a combination of the language, the libraries and tools available, and of course, documentation and community. Clojure’s first impression in this respect is very, very good. It has the feel of a polished product regardless that it only recently reached the magical version number 1.0.

I won’t type here yet another detailed description of what Clojure is, because it has been already written so well for so many times. I just say that the functional approach of Clojure is mind-blowing to an old-school programmer like me. Perhaps I’m going to write some articles on it once I get more into it. Meanwhile, here’s a concise collection of most useful Clojure links.

Official Clojure sites

http://clojure.org/
The main site.
http://github.com/richhickey/clojure/downloads
Clojure development is going on here.
http://groups.google.com/group/clojure
The place for discussions on Clojure.

Official Enclojure sites

http://www.enclojure.org/
The NetBeans IDE plugin. The .nbm also installs Clojure the language (clojure-1.0.0.jar) and the libraries (clojure-contrib-1.0.0.jar) into NetBeans’ Library Manager.
http://github.com/EricThorsen/enclojure/downloads
Enclojure development is going on here.
http://groups.google.com/group/enclojure/
The place for discussions on Enclojure.

Clojure learning resources

http://pragprog.com/titles/shcloj/programming-clojure
The first (and so far the only) book on Clojure.
http://java.ociweb.com/mark/clojure/
Mark Volkmann’s Clojure page, lots of links and information, especially http://java.ociweb.com/mark/clojure/article.html — maybe the best online tutorial on Clojure.
http://en.wikibooks.org/wiki/Clojure_Programming
Another online tutorial.
http://en.wikibooks.org/wiki/Learning_Clojure
Yet another online tutorial.
http://clojure-euler.wikispaces.com/
Solutions for Project Euler problems in Clojure.
http://cloud.github.com/downloads/richhickey/clojure/clojurecheatsheet.html
Clojure Cheat Sheet (html).
http://cloud.github.com/downloads/richhickey/clojure/clojure-cheat-sheet-a4-grey.pdf
Clojure Cheat Sheet (pdf).
http://github.com/stuarthalloway
Stuart Halloway’s (author of Programming Clojure) presentations, sample codes, etc.
http://blog.thinkrelevance.com/
Stuart Halloway’s blog.
http://sicpinclojure.com/
Structure and Interpretation of Computer Programs in Clojure.
http://www.assembla.com/wiki/show/clojure/Getting_Started
Getting Started in Clojure’s Assembla Wiki covers setting up various IDEs and editors.
Last modified: 2010-04-18 16:25 +0300


blog comments powered by Disqus