JRuby can access classes implemented in pure Java code. Clojure can generate a class file. Therefore it's straightforward for JRuby to access classes implemented in Clojure.
First I define a class with a method in plain Java.
MrJava.java:
Blogged by Ujihisa. Standard methods of programming and thoughts including Clojure, Vim, LLVM, Haskell, Ruby and Mathematics written by a Japanese programmer. github/ujihisa
JRuby can access classes implemented in pure Java code. Clojure can generate a class file. Therefore it's straightforward for JRuby to access classes implemented in Clojure.
First I define a class with a method in plain Java.
MrJava.java:
It gets better; you can use Clojure's persistent data structures from JRuby as well: http://github.com/technomancy/clojure-gem
ReplyDeleteUsing the STM is still not seamless since JRuby's Exception proxies get in the way of transaction retries, but with a little more work it could be done.
Thanks Phil for letting me know it!
ReplyDelete