Clojure: First Impressions
"the greatest single programming language ever designed"
- Alan Kay, on Lisp
"Greenspun's Tenth Rule of Programming: any sufficiently complicated C or Fortran program contains an ad hoc informally-specified bug-ridden slow implementation of half of Common Lisp."
- Philip Greenspun
"Lisp is worth learning for the profound enlightenment experience you will have when you finally get it; that experience will make you a better programmer for the rest of your days, even if you never actually use Lisp itself a lot."
- Eric Raymond, "How to Become a Hacker"
"Lisp has jokingly been called "the most intelligent way to misuse a computer". I think that description is a great compliment because it transmits the full flavor of liberation: it has assisted a number of our most gifted fellow humans in thinking previously impossible thoughts."
- Edsger Dijkstra, CACM, 15:10
As a relatively young developer who didn't go the whole university route, one of the things that I have always felt was lacking from not doing the CS thing was an understand of Lisp. When most of the greatest hackers of all time speak about a language in revered tones, you sort of wonder what it is that you are missing out on.
Deciding on learning a new language, I was hit by the whole "what to choose" thing again. Lisp has always been something I wanted to look into, but I had a bit of a problem digging into something at I perceived to be (at this point anyways) mostly an academic language. Enter Clojure.
Clojure
Clojure is a Lisp dialect for the JVM. The java integration seems (if anything) to be better then most JVM languages, which means you get all java libraries pretty much out of the box. It takes an opinionated stance on concurrency, and all data structures are both fast and immutable out of the box. In fact, to introduce any sort of mutability, you have to jump through some hoops. While the performance isn't at the level of java, it comes very close for most things, generally doing better then languages like JRuby and JPython.
As a web guy, all this means that you get existing java servers and infrastructure out of the box. There is also a minimalist web framework called Compojure which, while in its early stages, already is pretty awesome.
First Impressions
Probably something along the lines of "wtf.". I've got a decent amount of languages under my belt at this point, and usually learning a new one involves a whole bunch of easy to understand syntax, and then a couple of topics that require some work to wrap my head around. Clojure hasn't been like that. Pretty much from the first page of Pragmatic Clojure, it has been along the lines of "read two pages, realize I didn't fully grasp what was on the previous page, jump back and read it again".
I am nowhere near the point where I could write something more significant then a hello, world style app. That being said, I have been enjoying working at it, and have been very impressed by what I have grokked so far. More on this in weeks to come.