4 ms·
There are a few reasons one might choose to use JRuby. The most frequently cited reason is to take advantage of JRuby's generally quite excellent Java interope
by stephenjudkins 15y ago
There are a few reasons one might choose to use JRuby.
The most frequently cited reason is to take advantage of JRuby's generally quite excellent Java interoperability. In many cases it may be the best way to introduce Ruby into an organization with a large, legacy Java codebase. Further, despite its oft-maligned reputation, Java still offers the largest number of high-quality, performant FOSS libraries of any platform. In our case, we are developing a Rails application along with a supporting Scala library simultaneously. In my experience, JRuby/Java/Scala integration is largely painless.
Further, JRuby could legitimately be considered the best Ruby implementation. It's very rare to find pure Ruby code that works on any other Ruby implementation but not JRuby. JRuby is, in general, faster than Ruby 1.9 (and in almost all cases much faster than 1.8). Further, upcoming enhancements in JDK 7 may allow some very impressive speed-ups (see http://blog.headius.com/2011/08/jruby-and-java-7-what-to-expect.html http://blog.headius.com/2011/08/jruby-and-java-7-what-to-exp...).
- clyfe 15y agoI would use jruby if I were to build a product that: * has a web interface: take advantage or Rails * needs scientific computation like machine learning and such: take advantage of the java platform libraries
- vorg 15y agoJRuby's the only JVM language already making use of invokedynamic isn't it? Neither Groovy nor Clojure have implementations using it, and of course Java and Scala are statically typed languages.
- stephenjudkins 15y agoNo released language is making use of it, largely because there are no released versions of the JDK that have a usable implementation of it. However, Oracle is working on a JavaScript implementation that leverages it: http://www.wiki.jvmlangsummit.com/images/c/ce/Nashorn.pdf http://www.wiki.jvmlangsummit.com/images/c/ce/Nashorn.pdf. See also https://github.com/dynjs/dyn.js https://github.com/dynjs/dyn.js, another incipient JavaScript implementation.