Rob Blackwell home projects resumé archive

Getting Started With ClojureCLR

10 April 2009

I heard that Clojure had been ported to the CLR and I was keen to give it a go. You need to grab the source and build it yourself, but here’s what worked for me:

I use subversion and git installed as part of Cygwin.

I installed everything in c:\opt

First you need to get the code for Clojure-contrib from Kevin O’Neill’s repository

git clone git://github.com/kevinoneill/clojure-contrib.git

Then change into the clojure-contrib directory

cd clojure-contrib

Then you need to get hold of the Dynamic Language Runtime. At the time of writing, ClojureCLR doesnt build against the latest DLR, so I had to explicitly grab revision 10606. The required version is documented in C:\opt\clojure-contrib\ClojureCLR\versions.txt

svn co -r 10606 https://dlr.svn.codeplex.com/svn .

You also need the Visual J# Redistributable to provide BigInteger and BigDecimal. Download and install from here:

http://www.microsoft.com/downloads/details.aspx?familyid=f72c74b3-ed0e-4af8-ae63-2f0e42501be1&displaylang=en

Locate ClojureCLR.sln (C:\opt\clojure-contrib\ClojureCLR\Clojure) and open in Visual Studio 2008.

Its a pretty big solution, so you may have to wait a bit while Visual Studio does its thing.

At this stage, the whole solution probably won’t build, unless you have Silverlight, NUnit , Rhino etc – but don’t worry – You only need to build Clojure.Console – Right click on Clojure.Console and select build. Right Click again and say Debug, Start New Instance. And off you go ..

Clojure CLR

If you’ve read this far, you probably want to buy Programming Clojure by Stuart Halloway. It’s available in beta.

*The opinions expressed on this site are my own and do not necessarily represent those of Two10degrees or Active Web Solutions Ltd.