sw1nn

Adventures. Stories. Code.

ClojureScript - Browser Development Without the Warts

| Comments

I’ve been looking at ClojureScript for a while. The elevator pitch would go something like this.

ClojureScript is a dialect of clojure (itself a dialect of lisp). You have all the power of lisp, but it uses Google’s libraries, know-how and optimizing compiler to emit efficient javascript that runs standalone in the browser. It can interface with other libraries such as the industry leading jQuery to give you the best of all worlds in power and productivity

In the last few weeks there seems to have been a real uptick in interest. Some very exciting and cool demos are starting to show up on GitHub

To give you an idea of what’s possible - There was recently some discussion on the clojure mailing list about this video by Bret Victor (aka @worrydream, UI designer extraordinaire). In the video Bret demos a very interesting system he’s developed to allow developers to connect better with their creations. His premise is that by connecting better with what you’re developing you see things that you wouldn’t see in the usual code/test cycle.

After seeing that video, Chris Granger spent some time prototyping how such a system would look in clojurescript. The results are impressive to say the least. Chris then mentioned on IRC that he’d spent less than a day on it and actually most of the time had been spent on a problem not directly related to the prototype. The fact that Chris put this together in a few hours using a technology that’s not even out of nappies is a sign of where this is going.

Another fantastic demo by Chris is this control panel for Overtone (a very cool music synthesis environment developed in clojure)

Another interesting example is this Gin Rummy game.

A good introduction to the ClojureScript world is the ClojureScript One Example Project. This has really detailed documentation, clean design and annotated code. Well worth a couple of hours of your time.

Comments