Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What reasons would I have for not using JRuby over MRI/YARV?

Tags:

ruby

jruby

In Is there an advantage to running JRuby if you don't know any Java?, people were suggesting using JRuby if you just want a better implementation of Ruby than "Ruby" (MRI/YARV).

What potential reasons would you have for not using JRuby?

Ones that have been mentioned by others are:

  1. Performance for short programs. JRuby is described as faster for longer programs, but having a longer initialization time. Workarounds are discussed in this question.
  2. C extensions: JRuby supports some, but not all, C extensions that are used with MRI/YARV.
  3. Concurrency as a two-edged sword. There's non-thread-safe code out there that people haven't discovered because the most popular implementation doesn't have true concurrency.
  4. JRuby can use more memory.
  5. JRuby has decided not to do certain things CRuby does. This includes continuations (which I think are deprecated in CRuby anyway), and fork. They also have a different native endian, and time precision.
  6. JRuby doesn't enable ObjectSpace by default.

Potential reasons I have include:

  1. Libraries you use may not be designed to run under JRuby. For example, BioRuby, which has 127 watchers and 60 forks on GitHub, had a minor incompatibility with JRuby.
  2. Fear, Uncertainty, and Doubt about using a less popular implementation. I know JRuby passes RubySpec better than CRuby, but RubySpec is not yet complete.

Are there any other reasons you wouldn't use JRuby?

like image 813
Andrew Grimm Avatar asked Oct 13 '10 23:10

Andrew Grimm


1 Answers

Personally, while it comes pre-installed on Macs I don't always install Java on my Linux machines.

As an aside, RVM should probably be mentioned here as the canonical way to juggle multiple (8 or more?!) different Ruby interpreters.

like image 129
Neall Avatar answered Oct 26 '22 02:10

Neall