Tanaka Akira wrote:
> In article <3454c9680807250054i70db563duf44b42d92ba41bfb / mail.gmail.com>,
>   "Vladimir Sizikov" <vsizikov / gmail.com> writes:
> 
>> 1. RubyGems uses it to invoke #{RUBY_ENGINE}.rb file with
>> customizations, specific for particular implementation
> 
> I'm not sure what the customizations to be done.
> 
>> 2. Different implementations have different specifics, like JRuby can
>> 'require' a JAR file and need different activerecord drivers, etc.
>> There are also some JRuby-specific libraries that only make sens for
>> JRuby, and the whole Java Integration layer. So, folks need to figure
>> out when they run with JRuby and when they not.
> 
> Why don't just try "some feature"?

It's not quite that simple, since just having specific libraries doesn't 
mean they're exactly the same. And there are many libraries that may be 
only partially implemented on a given implementation. For example, 
callcc doesn't exist on JRuby, but you can't find that out without 
trying to call it. So you need a missing method check. JRuby has no 
syslog at present, so you need a load error check.

And this doesn't help RubyGems. If there's three different versions of a 
gem, one that works on Rubinius, one that works on JRuby, one that works 
on MRI...how should it choose the right one? By checking 
implementation-specific config information? By trying to load libraries 
that don't work today (but might work tomorrow)? There's too much 
complication in figuring out "which Ruby impl am I running", and adding 
a variable to explicitly state it is a clean, simple way to do it.

- Charlie