From: Charles Oliver Nutter Date: 2007-11-12T05:11:46+09:00 Subject: Re: enterprise ruby Rick DeNatale wrote: > In this implementation, Java primitives were written in Smalltalk. > IIRC this was either before the JNI existed, or the JNI evolved to > make this impractical, and IBM moved to a Java only VM. > > I know that it's difficult, and probably premature to define a > standard extension interface which would work across the various > emerging ruby implementations. But without that I'm afraid that the > promise of having multiple implementations is somewhat muted. This implies that it's only valid to call something an "extension" if it's written in C. That's a bit narrow. JRuby has far better support than MRI for writing extensions in Java, for example. Does it mean that JRuby is somehow less-capable than MRI if it can't use C extensions? Of course it doesn't. The only thing it means is that existing extensions written in C for MRI won't work in JRuby. That may limit you, if you depend on those specific extensions. But in most cases the same functionality is provided by Java libraries just as well. And even better, you don't need to compile anything. You can just call the library directly. include Java import java.util.concurrent.ConcurrentHashMap chm = ConcurrentHashMap.new chm[:bar] = 'foo' # etc This applies to Java's GUI libraries (around which several frameworks have been written, all in Ruby), graphics libraries, network libraries, and so on. Ruby has a much more difficult time using any of these libraries. So I'd say it's a matter of perspective. Can you write extensions for JRuby? Yes. Can you write them in C? Not easily. Can you write extensions for MRI? Yes. Can you write them in Java? Not easily. - Charlie