This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
The most important aspect of JRuby is that it is tightly integrated with Java that allows Java application talk to Ruby code. I dont think you need JRuby if you just need Ruby without integrating with any other language.
SCJP 1.6, SCWCD 5.0, SCBCD 5.0 [loading..]
Joined: Jun 29, 2009
I know. The question is: Everything that I can do using Java, I do with Ruby? Or I have to, in a specific case, integrate the languages?
Joined: Sep 28, 2008
This is what Sun says...
Why JRuby (over Ruby)
•With JRuby you get the best of both worlds: Ruby applications and libraries, plus Java libraries. And you can access those libraries with Ruby syntax (or Java syntax, if you want).
•On average JRuby, runs 2 and a half times faster than Ruby, except at startup
•In addition to native threads, JRuby supports Unicode natively
•Code can be fully compiled ahead of time or just in time
Why (J)Ruby over Java?
• Ruby is fun, beautiful, and powerful language
• Ruby has features missing from Java
> Closure (blocks)
> Open classes
> Meta programming
• Domain Specific Language (DSL)
> Through (J)Ruby's capability of allowing expressive method names and cushy semantics
You've had some great answers above but yes, JRuby is very good and ready to go. It's considered production ready and it's not really a "beta" or anything like that anymore. Whatever you can on Ruby, you can run with JRuby on the JVM now and... considerably faster in most cases too!
In theory you can do whatever you can do with Java with JRuby but.. I suspect there are some exceptions! I've not seen people developing applets, for example, but I suspect it's possible. JRuby can "compile" code but I'm not sure how far it goes and whether you end up with completed .class files. I believe you can (I'm not really a Java guy) but then a JRuby JAR comes along with it to run the more dynamic parts.
I'd only add that I've read a number of articles that have Yarv beating JRuby. I am excited for JRuby's future, not as much because I want to keep using Java libraries/accessing legacy Java code - but because Ruby code can then leverage the benefits of the JVM as a platform (and app servers like Glassfish).