I’ll provide a slightly different answer…
JRuby can link in native libraries and make native calls, but the C
API exposed by Ruby demands a lot more than that. Specifically, it
requires the internal structure of objects to look a specific way,
requires direct memory access to those objects, and requires the
ability to modify object contents directly. None of these things are
provided by the JVM’s C API, and as a result there’s no way for us to
support them.
There is a possibility that in the future JRuby could support the
“safe” subset of the Ruby C API that doesn’t require direct memory
access, and there’s actually going to be a Ruby Summer of Code project
to attempt it. But we’ll never support the “unsafe” subset, so many
(most? all?) C extensions will require modification to work.
To answer your other questions:
Question: Why does some gems have build gem native extensions to get
installed by
ruby 1.8 or 1.9.1 ??
Answer: Because some of those gem authors felt they needed native (C)
code to accomplish the goals of their gem. The two usual requirements
are that the gem depends on a C library or that the C code is for
performance-intensive logic inappropriate for Ruby code.
Question: Does rubygems downloads a source and then they are compiled to
be
executable?
Answer: Yes, that’s exactly what it does. Some authors will also ship
precompiled versions for specific platforms, but ultimately all such
gems require the Ruby C API be available. Until we can support that
API, those gems will not work with JRuby.
On Wed, May 12, 2010 at 3:26 AM, Matthew K. [email protected]
wrote:
things done and didn’t mind if people shot themselves in the foot.
Why does some gems have build gem native extensions to get installed by
–
“life is complex, it has both real and imaginary components”
http://threebrightlights.blogspot.com
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email