aspose file tools*
The moose likes Ruby and the fly likes JRuby benefits? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Languages » Ruby
Bookmark "JRuby benefits?" Watch "JRuby benefits?" New topic
Author

JRuby benefits?

Phelipe Maia
Greenhorn

Joined: Jun 29, 2009
Posts: 14
What is the benefits of JRuby? Do you recommend JRuby? If I want to use ruby, I have to use just Ruby without other languages?
Himalay Majumdar
Ranch Hand

Joined: Sep 28, 2008
Posts: 324
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..]
Phelipe Maia
Greenhorn

Joined: Jun 29, 2009
Posts: 14
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?
Himalay Majumdar
Ranch Hand

Joined: Sep 28, 2008
Posts: 324
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
> Duck-typing
• Domain Specific Language (DSL)
> Through (J)Ruby's capability of allowing expressive method names and cushy semantics
Peter Cooper
Author
Greenhorn

Joined: Jul 17, 2009
Posts: 25
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.


Author of Beginning Ruby (Apress): http://bit.ly/t31ag
Editor of Ruby Inside and RubyFlow
Michael Sullivan
Ranch Hand

Joined: Dec 26, 2003
Posts: 235
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).

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JRuby benefits?