Home > clojure, ruby > Familiar: Clojure plus Ruby

Familiar: Clojure plus Ruby

October 9th, 2011

Last week I had three separate conversations with people about using Clojure’s data structures and concurrency primitives from a language that’s not Clojure. Something about parens or insisting on using a less capable language :)

So, this weekend I played around with using Clojure from Ruby, in particular JRuby. I haven’t done much Ruby in about a year, so I spent most of my time remembering that. Anyway, I ended up with a proof of concept: Familiar. See the readme there. Here’s an example:

That’s it. This gives full access to the clojure.core API including lazy seqs, STM, and all those goodies. Good idea? Idiotic? I don’t know, but it was a fun exercise.

clojure, ruby , ,

  1. October 15th, 2011 at 09:13 | #1

    This looks relly neat. When I talk to Rubyists about clojure they often stumble on the syntax and miss out on the bigger picture of clojure and how it addresses state. I think Familiar would be a great way to introduce the core concepts of clojure before the actual language. Thanks for sharing!

  2. October 16th, 2011 at 17:22 | #2

    @Ben Mabey
    Thanks! That’s what I was hoping for. A “familiar” place from which to get acquainted with Clojure. It’s funny because returning to Ruby from Clojure, I found myself stumbling on the Ruby syntax, especially the significant commas. :)

  1. No trackbacks yet.