tags:

views:

50

answers:

2

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?

+1  A: 

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.

Neall
A: 

JRuby doesn't seem to give $SAFE a high priority. The blog post is from 2007, but I haven't come across any changes since then.

Andrew Grimm