A tour of the Clojure landscape

Clojure landscape

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.

Some good introductions include Hugo Duncan’s article on shell scripting, and Chas Emerick’s article on continuous deployment of web applications.

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.

12 Comments

Filed under Programming

Clojure presentation at GatorJUG

This article has been archived because much better Clojure resources are available now. Some of my favorite Clojure learning resources include Learn Clojure and Clojure web applications on Heroku. You can also find commercial support at Clojure Core.

6 Comments

Filed under Programming

Compojure security: authentication and authorization

This article has been archived because much better Clojure resources are available now. Some of my favorite Clojure learning resources include Learn Clojure and Clojure web applications on Heroku. You can also find commercial support at Clojure Core.

19 Comments

Filed under Programming

Using PostgreSQL with Compojure

This article has been archived because much better Clojure resources are available now. Some of my favorite Clojure learning resources include Learn Clojure and Clojure web applications on Heroku. You can also find commercial support at Clojure Core.

9 Comments

Filed under Programming

Compojure on a Slicehost VPS

This article has been archived because much better Clojure resources are available now. Some of my favorite Clojure learning resources include Learn Clojure and Clojure web applications on Heroku. You can also find commercial support at Clojure Core.

18 Comments

Filed under Programming

Winning a helicopter

I won a helicopter at a gift-stealing game at work today.

helicopter on a table

Rules

Everyone brings a wrapped gift for the gift pile. The gift must cost less than $25 – mine was a board game called Cranium. A round begins by randomly selecting a player who has not yet been selected. That player can either choose a wrapped gift, opening it for everyone to see, or steal someone else’s gift. If a player’s gift is stolen, it is that player’s turn to take a gift from the pile or steal another gift. Each gift can be stolen up to three times. A player can not steal a gift that has already been stolen from that player in the same round. A round is over when a player chooses to open a new gift rather than stealing, and the game is over when all gifts have been opened.

Playing

I started the first round, having drawn the number 1 from a hat, and selected a gift from the pile. It was Helicopter Storm, a remote-controlled helicopter. I had never flown one of these before – it looked like a lot of fun.

helicopter in the box

Scott stole my helicopter a few rounds later. He said that he would enjoy that helicopter for a good ten minutes, right up until one of his cats caught up with it. Those, he laughed, would be very good minutes.

There were a lot of nice gifts, but only two fun gifts: Cranium and the helicopter. Walking out with my own gift, Cranium, wouldn’t have felt right. I wanted that helicopter. I needed a gift that would be stolen from me, so that I would have another shot at the helicopter. Wine was a popular gift. I stole a bottle of Amarula Fruit Cream from Pam.

bottle of amarula fruit cream

It was not until the final round that someone stole my wine. I tried to retrieve the helicopter – Scott blocked me. He could only do that once, so I just had to stay in the game a bit longer. All of the wines had been stolen two or three times, so those wouldn’t work. I have little interest in coffee, but that was also a popular gift. I stole some coffee mugs and coffee from Clint, my boss.

My coffee was stolen quickly, and Scott was unable to block me again. The helicopter was mine!

Now I just need to learn how to fly it.

helicopter on a table

1 Comment

Filed under Personal

Pineapple jerk chicken

  • Ingredients:
    • 3 lbs boneless, skinless chicken breast
    • 8 oz KC Masterpiece spiced Caribean jerk marinade
    • 1/4 cup flour
    • 40 oz crushed, unsweetened pineapple
  • Directions:
    1. Cut chicken into half-inch chunks.
    2. Combine the chicken and marinade and let sit for at least thirty minutes, preferably overnight.
    3. Fry the chicken-marinade mixture until the chicken is fully cooked.
    4. Stir in flour, followed by pineapple.
    5. Continue cooking until the mixture is hot again.
    6. Serve hot.

May be used as a side dish or topping. Good with steamed rice.

1 Comment

Filed under Recipes