the things that make us happy make us wise

Minimalist Clojure Tooling

I've been trying to get started again with Clojure, after a fairly shaky start a couple of years ago. To this end I've enlisted the excellent book Seven Languages in Seven Weeks by Bruce Tate. Each chapter covers a different language and the exercises are challenging enough to be interesting.

I've always been fond of a minimalist development environment (especially coming from a heavy Java background), so I tried out a couple of suggested approaches.

vim + fireplace

The first thing I tried was a combination of vim and the vim-fireplace plugin. Updating the version of vim that came with my mac, which turned out to be too old for the plugin, was only mildly fiddly with the assistance of homebrew. Regardless, macvim does work quite nicely. I also installed the vim-clojure-static plugin, which handles highlighting and syntax and so forth.

I found this a workable solution. I'm probably not as fast with vim as I should be, but I only needed a handful of key combinations to get a decent eval loop going.

However, it is not as slick as I would like. I had some trouble getting Eval to work in conjunction with lein repl to begin with, and the author himself states:

You know that one plugin that provides a REPL in a split window and works absolutely flawlessly, never breaking just because you did something innocuous like backspace through part of the prompt? No? Such a shame, you really would have liked it.

The screenshot above shows the evaluation for all the code. Note how it only shows the evaluation results for the last line.

Lighttable

Then I tried Lighttable. This project aims to provide instant feedback on your code as you develop. I backed the Kickstarter for this project quite a while ago and then never got a chance to use it. But it's come a long way since then, and I'm impressed.

It provides a nice clear view of your code, and best of all the eval-loop is near instant. The only delay I encountered was setting up the dependencies the first time. Above you can see a screenshot showing how the evaluation results appear inline. Note how all the line evaluations are shown, unlike the vim example.

Problems are shown inline too, for example:

Verdict

In the end I chose Lighttable. While still in alpha, I still found it less fragile and fiddly than vim+fireplace, and it provided quicker and better feedback.