Thursday, November 3, 2011

ClojureCLR: genesis

In the BOF for ClojureCLR at the recent Clojure/conj 2011, there seemed to be some interest in the genesis of ClojureCLR.   For the record, here's the story. 

Rich Hickey's original Clojure implementation effort targeted both the JVM and the CLR.  Rich said that he "got tired of doing everything twice", and  eventually dropped the CLR effort to focus on the JVM.

In the fall of 2008, I had several itches I wanted to scratch:  I wanted to code a decent-sized project (tired of just programming examples for my lectures);  I wanted to do some Lisp, something I had not done for over 15 years;  I was interested in spending more time in the dynamic language world; I wanted to learn more about current practice in functional programming; and, with the advent of things like JRuby and IronPython, I wanted to understand how dynamic languages were being implemented on top of things like the JVM and CLR.

While poking around, I ran into Clojure and then the Dynamic Language Runtime (DLR) for .Net.  So I decided to look into the feasibility of implementing Clojure on the CLR platform using the DLR -- pretty much scratching all itches at once. That was in October to November, 2008.

I had a basic proof-of-concept implementation--basic data structures, reader, evaluation based on compilation into DLR ExpressionTrees and then into IL--by the beginning of 2009.  On January 12, 2009, I sent an e-mail to Rich Hickey with a picture of the famous ants simulation running on the CLR with a WinForms GUI.  Slow as molasses, but it ran.  More than 90% of core.clj loaded at that point.

Introducing myself to Rich, I stated:
 I feel no need for this code to see the light of day.  However, if the code reaches the point of usefulness – 98% feature-complete and performance no worse than 2X of the Java implementation, say—and if no better implementations on top of .NET have surfaced, and if you are  interested, then I'd be happy to turn it over.
I asked Rich if he would mind an occasional query as I moved forward.

Rich responded, in part:
What is important to me is that any effort I apply ends up in the Clojure project. Towards that end, I would ask you to consider making your efforts a contribution to Clojure under the contributor agreement. Then, your .Net port could live in clojure-contrib alongside ClojureScript (a port of Clojure to JavaScript). The long-term objective would be a set ot core .clj files that supported all ports without changes, all platform specifics isolated in the support libraries.
I understand that you feel your work is still in the early stages, but would encourage this contribution sooner rather than later:
  • The community can get behind a single, supported effort.
  • I can understand the issues you are facing and incorporate that in my decision making process.
  • You can incorporate my feedback earlier in your process
  • You can get help. 
The open source community is pretty tolerant and understands work-in-progress, so being nearly complete is not a pre-requisite. Nor should you be concerned about losing control over the direction of the implementation - I understand the satisfaction of authorship, and the drawbacks of teams. clojure-contrib is a small group and each principal author retains stewardship over their library. 
In short, I'm very interested in what you've done and interested in supporting it under the aegis of the Clojure project.
A little more work, gettting the CA in, etc. and ClojureCLR went public in February, 2009, as part of clojure-contrib.  It was moved to its current home in Rich's account on github in June, 2009.

And that's how it started.

No comments:

Post a Comment