21 Jul 2010, 3:21am

Getting started options for Clojure

When I first installed Clojure, I had a working java environment on OS X, so all I had to do was download the clojure jars.  Then I ran the REPL with
java -cp clojure.jar clojure.main

That got packaged into a shell script, clj, which was added to my path and chmod +x so that I could run the REPL with
clj

That worked for a while, but then I got frustrated not having command history (arrow up to get your last so many commands).  I followed the instructions here to use the JLine ConsoleRunner, which works just fine.

(Here is another set of instructions to do the same thing, but with rlwrap.)

When I went exploring for more Getting Started material, I found the Clojure Assembla, which led me to Leiningen and labrepl.  This made me rethink how I got clojure in the first place.  Akin to test-driven development, you can do something along the lines of “deploy-driven” builds – get your tools/environment with the build tool.  Clever.  Here are  some great instructions on how to get clojure using the clojure build tool, Leiningen.

There is also cljr, but I have not used that yet.

I got Leiningen and labrepl installed and started working through some of the labrepl exercises.  It’s nice to have some more supporting learning materials in addition to the Programming Clojure book.  It is a good introduction to the language, but it is not Learning Clojure.  I will likely also get Joy of Clojure.

For some background on where Clojure came from, there is Rich Hickey’s keynote at the 2009 JVM Language Summit.

16 Jul 2010, 4:12am

Clojure

So many things, mostly work, have been keeping me busy that I have not had time to do any game programming for the past year.  I have not given up, though.  My current interest is HTML5/Javascript game programming, sparked mainly by the Google Pacman logo.  I found a great canvas intro tutorial that is very thoughtfully put together and fun.

What I am fully immersed in right now, though, is learning Clojure.  I am reading Programming Clojure and a variety of online resources.  Functional programming languages have always been an over the horizon quest for me.  A bit of Lisp in college Programming Languages, a few months of watching SICP lectures, read part of an Erlang book, etc.  I have never quite gotten it, though.  Now the light bulb is finally starting to go off.  I don’t know if it’s that I’ve reached a brain critical mass or if it’s Clojure.  I went to a functional programming meetup, and foldr finally really made sense to me.  That might have just been due to how well it was presented there, though.