GETTING STARTED WITH CLOJURE

17 Oct 2014 by Curtis

I recently found some interesting work going on in terms of using Clojure code to represent policy, or perhaps intent, of infrastructure (ie. tiered web apps and the like), and I wanted to try it out. That meant getting a Clojure environment up and running, so that is what is in this post: getting a basic Clojure environment on OSX, compiling a jar, and running the Clojure shell (REPL).

There is a big list of books, articles, tutorials and other documentation on the clojure website.

Also--Clojure Koans might be an even easier way to get started with Clojure.

Java

Most of the time I just refuse to install Java. However, if I want to checkout Clojure there's not much choice. So here we go.

I installed Java for OSX. I'm just using the Java that Apple provides. Please note that I didn't do any research on the best Java SDK to use or anything, essentially just used the first link that came up, which was Apple's package.

REPL

Clojure also has a kind of shell: a "read-eval-print-loop" (REPL). I love languages that have a shell of sorts, like python (and even better, ipython) irb in ruby, and others. It's great to be able to quickly try things out and explore in a language shell.

Conclusion

At this point we have a basic Clojure environment up and running, one that can be used to explore all the cool Clojure code out there. I'm not a big fan of Java, but the JVM obviously allows some interesting applications.