2014-03-19 Leiningen

A while ago I wrote a little demo application using Clojure for the company’s blog in 2010 (in German). This is a Lisp that compiles to Java Byte Code and therefore it runs on the Java Virtual Machine. It also allow you to call all the Java libraries you want, using Lisp syntax. As I work with Java for money and Emacs Lisp for love, I thought this was perfect for me. Recently I had the idea of porting this little app to the web, possibly for use on my iPad. But how to do it? I thought of ClojureScript. It compiles to JavaScript! Maybe using ClojureScript and some SVG library... maybe C2, subtitled “Clojure(Script) data visualization”? But where to get started?

Clojure

in German

ClojureScript

C2

The ClojureScript One Guide assumes that you have Leiningen installed. OK, time to look at the Leiningen tutorial. And what better way to start than moving my old application to a Leiningen setup?

ClojureScript One Guide

Leiningen

Leiningen tutorial

So that’s what I did. On my Mac, using Homebrew, I can run Gridmapper as follows:

Homebrew

Gridmapper

brew install leiningen
git clone git@github.com:kensanata/gridmapper.git
cd gridmapper
lein run

And I can produce an executable Jar file and run it as follows:

lein uberjar
open target/gridmapper-0.9.9-standalone.jar

In 2010, I was mostly interested in figuring out whether Clojure would in fact allow me to use Java libraries. In terms of architecture, the application is lousy. A Model View Controle architecture should be used! And instead of bitmaps, I’d like to use SVG graphics both for the tiles and for the resulting output. Save as SVG! Also, a nicer window with a legend and some explanations would be nice.

Anyway, back to C2.

​#Clojure