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


.



Relevant Pages

  • Re: enterprise ruby
    ... and IBM moved to a Java only VM. ... JRuby is somehow less-capable than MRI if it can't use C extensions? ...
    (comp.lang.ruby)
  • Re: Differences between C++ and Java
    ... > are *implementation* defined and the standard also specifies the ... > "In Java, garbage collection of unreferenced objects is automatic. ... > C++, you manually manage memory. ... > provide third party libraries that work just as well, ...
    (comp.lang.java.programmer)
  • Re: MD5 Myths
    ... John: I think I'm mixing things/apps in my mind as I type. ... upload and use my own libraries and place in a folder of my choosing. ... On deck for me is a Java shopping cart/ eCommerce using SSL, ...
    (sci.crypt)
  • Re: Desktop multi-plataform ruby app (Tk and swank for jruby)
    ... at sun staff are going a great job around jruby: ... is to port the standard Tk tool kit to java. ... to find some inconvenient of jruby ower ruby (but the big one is ... And the number of Java libraries available is legendary. ...
    (comp.lang.ruby)
  • Re: I wish to learn Ruby ,can anyone teach me???
    ... First, let's get the FUD out of the way: Ruby comes with a lot of libraries, ... Here's the biggest problem I have with Java: Right there, ... Now let's try that in Ruby: ... and I would call it the perfect beginner's language. ...
    (comp.lang.ruby)