tags:

views:

125

answers:

2

I've never used Jruby and I don't know why I should, but some people use it to complement the missing Java features in the Ruby language.

So I wonder if Ruby will ever support the missing features Java does in the future so we do not need to learn Java?

What do you think?

A: 

No, it won't. Java and ruby are two languages with two different goals. If you want those "missing features" you already have a solution -- jruby.

Bryan Oakley
I don't agree that they're two different languages. They're two implementations of the same language.
sepp2k
@sepp2k: you misunderstood -- ruby and java are two different languages. I'll edit my answer to be more clear.
Bryan Oakley
+3  A: 

The only features that jruby has which C ruby does not are that you can access java libraries (on the other hand C extensions can be used with C ruby, but not with jruby, naturally) and that you can compile your code to .class-files. Jruby doesn't have any language features that C ruby doesn't have.

To answer your question: it's doubtful that the C ruby interpreter will ever allow you to call java libraries or include an option to compile to java bytecode.

As a sidenote: You don't need to know java to use jruby. Unless you're using C extensions, any ruby code that runs on C ruby should run on jruby without modifications. You also don't need to know any java to use java libraries from jruby, though you should obviously know the API of the library you're using.

sepp2k