• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Junilu Lacar
Sheriffs:
  • Tim Cooke
  • Jeanne Boyarsky
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • fred rosenberger
  • Frits Walraven

Ruby

 
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I would like to know more about Ruby and JRuby, specifically what is the difference between the two...and where these languages are ideal to apply?
 
Ranch Hand
Posts: 235
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is a list of the different Ruby Implementations I've heard of (referenced from Wikipedia):

Ruby or MRI: Matz Ruby Implementation, implemented in C. This is the original Ruby implementation
YARV: likely candidate of Ruby2.0
JRuby: Ruby implemented in Java
IronRuby: Ruby implemented on a .net platform (on top of the CLR using the DLR)
Gardens Point Ruby.net: Ruby on a .net platform (on top of the CLR without using the DLR)
Cardinal: Ruby for the Parrot VM
MacRuby: Ruby 1.9 running directly on top of Mac OS X core technologies
MetaRuby: Ruby based implementation of Ruby, using ruby2c
Rubinius: Implementation of a Ruby VM almost entirely in Ruby


So, to answer your question - the original Ruby implementation is written in C, and JRuby is a ruby port in Java. If you needed to run Ruby on the JVM, or wanted to do so in order to have two-way communication between Ruby and Java - you'd use JRuby.

From JavaWorld

Dynamic languages like Ruby are most commonly used for specialized areas such as gluing other systems together; JRuby takes on this role in the Java world. For example, JRuby can pull data from one system, transform it and insert it into another. When the requirements change, modifying a JRuby script is as easy as changing a configuration file, thereby avoiding the complex compile-and-deploy cycle of Java integration code.

In addition to calling Java from Ruby, you can call Ruby from Java, making your application scriptable. With JRuby's minimal syntactic overhead, you can create an easy-to-use domain-specific language for users to work with (see "Creating DSLs with Ruby" by Jim Freeze). "



Hope that helps!
 
Author
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As Michael noted, JRuby is merely an implementation of the Ruby language on the JVM. So, effectively there is no difference, but as always, there will be "artifacts" between the two due to implementation details (f.e., threads perform better but behave a little differently in JRuby).
 
Whatever you say buddy! And I believe this tiny ad too:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic