Saturday, 21 August 2010

Side Projects: Gnomon

As I'm frantically running around doing stuff, I figured it'd be a good time to dump some of the small projects I've worked on in my spare time.

First up, the little Clojure/Scala interop project tentatively called Gnomon. Nothing to see here graphically, the fun part is just having a little space in which to evaluate Clojure directly. Rendering commands are pushed from the Edit Window thread (using the (render-command ...) and (render-static ...) macros) by simply converting the s-exprs to strings, and then evaluated on the render thread. The bulk of the app is written in Scala, but all the fun stuff happens in Clojure.

The editor itself is amazingly crude, but it was more a proof-of-concept for a joint Scala/Clojure project. There's a little awkwardness due to Scala frequently emitting a variety of name-mangled classes, but it still works surprisingly well - Clojure provides a certain flexibility and ridiculously easy runtime augmentation, while it's easier to generate a (more) efficient statically-typed framework in Scala, and Java interop on both sides provides for easy communication.

I'd love to follow this up at a later date with a proper project.

No comments: