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

Online postage adventure

The US Postal Service had a great idea: selling mailing labels online, postage included, and letting customers print the labels from the comfort of their homes. As much as I love the idea, I ran into a lot of problems when actually using the service.

This Monday was the first time that I created a mailing label online. I entered my shipping information four times before I was finally able to print out a mailing label, at which point I paid more than double the usual price for postage. Happy customer? Not really…

The first time I filled out the form, I ran into a question about weight, with separate fields for pounds and ounces. This format implied that I needed an answer accurate to within about an ounce (no, I didn’t have a postal scale lying around). I determined that my cell phone was 2.7 ounces and, after much fiddling with strings and coins, determined that my package weighed a bit less than the 2.7 ounce cell phone. I rounded up a bit and said that my package was 3 ounces. Wouldn’t it have been nice to know that any package under one pound would be the same price?

After providing the weight and a variety of other information such as sender address, recipient address, and how much insurance I wanted (with no indication of the cost), I moved to the next page. This was my first indication that printing my own label would actually cost me extra money: Media Mail was not on the list of service options. I chose the cheapest option, Priority Mail, agreeing to pay more than double the usual cost of shipping a CD. Perhaps I was lured in by the thought that I was almost done, how far from the truth…

The next page asked for my username and password. This disgusted me even more than being asked to pay double. Of course USPS needs me to have a permanent account before they can sell me some postage. That makes about as much sense as carrying around a Kash n’ Karry savings card just to buy items at the marked price.

I went through the process of creating an account, capitalizing the first letter of my password and changing a punctuation mark into a number so this silly site would consider my password secure… and then it wants me to create security questions. If I forget the bizarre password that they made me create, I can still access my account just by telling them my mother’s maiden name? Don’t they know that such information is publicly available? I type random keys after each security question so no one can use this backdoor into my new and totally unnecessary account, then I move on to the next page, expecting to enter my credit card information… only to find myself back on page 1. USPS forgot everything I had told it about my package!

After the second time entering all that information, I had to stop partway through to take care of something. Apparently leaving the keyboard for a couple minutes is enough for my session to time out – back to the beginning again.

On the third time entering all that information, I actually got to the point of creating a PDF of my mailing label… and Acrobat Reader froze up. After so many months of good performance by Acrobat, and after so many problems with the USPS site, you can bet I won’t blame Acrobat when one more thing goes wrong!

And on the fourth time it just worked – paying double the cost of Media Mail, of course.

Strangely enough, I was not discouraged by this experience. Rather, I was determined to master the art of online postage, saving myself countless trips to the post office. The adventure continued! A couple days later, I needed to mail a PHP/MySQL book that I had sold on Amazon Marketplace. Trying USPS’s online service, Click-N-Ship, wasn’t even a consideration, but I knew that there were several 3rd party vendors for the same service. Surely one of them would offer better service. The four options were eBay, stamps.com, endicia, and Pitney Bowes.

eBay was the only one of the four vendors that did not require monthly fees (I am wary of free trials, especially risk-free trials with lots of incentive gifts). eBay also doesn’t require any software installation (viruses, registry corruption, security vulnerabilities…) Unfortunately, eBay also requires that payments be made via PayPal, which would have taken too long to arrange. None of the other vendors really stood out, so I took the next on the list: stamps.com.

Stamps.com requires a monthly fee for using the service. I signed up for their free, 30-day, no-risk trial, expecting to receive a bunch of free stamps and a postal scale in the mail. My suspicion was aroused when I realized that cancelling my no-risk trial would involve a phone call. I was imagining being put on hold forever, so I tried calling the number before signing up. I reached an automated system which asked the reason for my call (cancelling an account) then asked for my phone number. It told me that this phone number did not correspond to one of their accounts. Could their account cancellation actually be semi-automated? My suspicions were significantly reduced, and I finished the account activation… then they asked me to download their software.

Downloading software from a company that I don’t trust… my suspicion was back and stronger than ever. It could be adware. It could be designed to steal passwords. It could have accidental errors that cause registry corruption or create security vulnerabilities on my computer. I don’t install software lightly! I started searching for reviews of the stamps.com software and found the following gems at download.com:

“You pay for what you get! You Definatly pay!”

“False advertising, promises come slowly”

“Nothing Good about stamps.com unless your a millionaire!”

“After waiting for 45 minutes I finally got a hold of someone. After canceling I asked a bout my $15 refund request, and come to find out I will not be getting my money back! I have to have an exsisting account in order to get a refund. I have just been robbed! $15 isn’t a lot, but my husband and I work hard for our money! Don’t open an account with stamps.com!”

“Can sign up online, but have to call to cancel. First 3 tries I got busy signals. I called again and got through their menu only to be placed on death-hold. Still on hold, it’s been 45 minutes, listening to god-awful muzak all the while. They are trying to get me to hang up, but it’s worth not paying the monthly fee to hang in there and be done with these people. Wish I’d read these reviews before I signed up. 😦 Don’t sign up, you’ll regret it.”

At this point, my interest in online postage was at an all-time low. I just wanted to drop that account before ending up like all the others. To stamps.com’s credit, I was actually able to cancel in about ten minutes. Maybe they are starting to learn a lesson about how to treat customers, but I was done experimenting. It was time to get this job done the old fashioned way.

The nearest USPS post office was 1.5 miles away. A few minutes in line… another minute for a real person to take my package, charge me regular price ($2.07 for a 1.92 lb package by Media Mail), and take care of everything… A physical post office took care of me in less time than it took to fill out a form online. I know that websites are a better technology, that they could easily beat the convenience of a physical post office, but it’s amazing what so many web designers will do to ruin a customer’s experience online.

1 Comment

Filed under Personal