I am working on an automatically-generated, browseable directory of Clojure libraries. If I am viewing a library in such a directory, the directory should be able to give me a list of other libraries that I should consider instead, as well as a list of libraries that work well with this one. The directory application could infer such information automatically based on how often various libraries are used together on Github.
While I originally generated the map above as an intermediate step towards that goal, I also found the map itself interesting. There were a lot of projects that I hadn’t heard about, and those that I did know about tended to be close to eachother. Did I actually have a position on this map, so that I would only hear about nearby projects? With that in mind, here is a quick tour of Clojure’s landscape. Clojure’s community is growing fast, and it can be hard to keep up with all the projects. Hopefully I can introduce you to some interesting projects that you haven’t heard of before.
1 ) The capital city: Clojure and Clojure-contrib
This is where Rich Hickey and other Clojure/core members are hard at work on Clojure 1.3, including performance improvements such as primitive function arguments, primitive return values, and pods. Clojure/core also provides support, mentorship, training, and consulting services for companies that are adopting Clojure. You can learn more in Rich Hickey’s recent InfoQ interview. I just sent in my contributor’s agreement and am eager to join the effort.
2 ) Building Clojure projects: Leiningen
Leiningen is an easy-to-use alternative to Java’s Ant and Maven. It provides built-in commands for common tasks like downloading dependencies, compiling the project, creating a JAR file, and launching a REPL. Leiningen’s creator, Phil Hagelberg, has been remarkably effective at soliciting contributions, and a wide variety of community plugins provide additional Leiningen commands.
3 ) Dev Ops: Pallet and JClouds
Pallet is an alternative to shell scripts and manual server administration. It communicates with cloud providers tostart up new instances, configure those instances based on predefined recipes, and perform day-to-day tasks like deploying new versions of an application.
Behind the scenes, JClouds allows the same commands to work for a variety of cloud providers.
4 ) Cake: a Leiningen rival
Cake competes with Leiningen as a Clojure build tool. It is compatible with most Leiningen project.clj files, and comes with extra features such as fast start-up, a dependency based task model that allows you to extend existing tasks, and an enhanced REPL with paren matching and tab completion.
5 ) Web development: Ring, Compojure, Enlive, Hiccup, and Sandbar
So far, Clojure’s web development options are based on small, easily-composable libraries. In other words, more like Sinatra than Rails. Ring provides an abstraction over web servers, as well as support for defining middleware. Compojure takes care of routing. You can generate HTML with Enlive if you prefer pure HTML templates, or with Hiccup if you prefer to write views directly in Clojure. Sandbar takes care of some of the remaining issues, like authentication/authorization and form validation.
Conjure is another option, which is closer to the Rails style.
6 ) Beginner’s projects: TryClojure, Clojure 101, Clojure Koans, and LabREPL
Each of these projects helps new Clojure programmers to learn the language. Try Clojure allows you to try out Clojure in your web browser, no download required, and even includes a small tutorial. Clojure 101 and these notes are training materials for an online course offered by RubyLearning. Clojure Koans is a test-driven approach to learning, in which you fix small code examples to make tests pass (based on a similar project for Ruby). LabREPL is part of the training materials for Clojure/core‘s Clojure training program.
7 ) Testing: Midje and Lazytest
Both Midje and Lazytest are alternatives to the clojure.test framework that is built in to Clojure. Midje encourages a separation between the actual tests and “checkers” that determine whether a test passed. Lazytest can be set up to watch your project’s files, and rerun the tests automatically whenever your source code changes.
8 ) Musical Clojure: Overtone
I was surprised and delighted to discover Clojure’s musical island, at the bottom of the map. Jeff Rose created Overtone as a replacement for a Serge Modular synthesizer that he enjoyed playing with, but that didn’t have a save button or other nice abstractions. He presented Overtone at a Rails conference (video).
9 ) Further into the frontier
Brian Carper’s Cow-Blog is so far out on the frontier that it doesn’t even show up on my map. This blog engine seems to be rather rough around the edges, but I’m considering migrating my own blog from WordPress to Cow-Blog. I like the idea of taking a peek under the hood and tinkering with the Clojure code. Plus, it looks like it comes with support for syntax highlighting of code examples.
I created the map above by tying projects together that share at least two contributors. Naturally, any single-contributor projects wouldn’t show up on such a map, and projects with only a few contributors also have low odds of showing up. Several startups have used Clojure for distributed computing, but projects like Cascalog(video), swarmiji, and clojure-hadoop aren’t on the map.
What other projects should be included in a tour of Clojure? Share your ideas by commenting below or on Hacker News.