« Return to Thread: Re: Trying to get jruby classes/methods into java code. (JRuby applet, OGL)

Re: Trying to get jruby classes/methods into java code. (JRuby applet, OGL)

by Charles Oliver Nutter-2 :: Rate this Message:

Reply to Author | View in Thread

Rob . wrote:

> Headius' post about 'Compiler #2', made it sound like this was going
> to be possible (http://headius.blogspot.com/2007/09/compiler-is-complete.html):
>
> "Compiler #2 will basically take a Ruby class in a given file (or
> multiple Ruby classes, if you so choose) and generate a normal Java
> type. This type will look and feel like any other Java class:
>
>     * You can instantiate it with a normal new MyClass(arg1, arg2)
> from Java code
>     * You can invoke all its methods with normal Java invocations
>     * You can extend it with your own Java classes"
>
> Is the JRuby 1.1 compiler not the 'Compiler #2'?

It is not. Compiler #2 will still happen, but it was deferred to after
the 1.1 release since it requires a lot more ingenuity and doesn't
really improve regular Ruby compatibility or performance (1.1 was mostly
focused on finishing Ruby support). But I have been wanting this
capability more and more myself, so this work is probably going to start
soon.

The biggest thing that would help is coming up with some ideas about how
to map Ruby scripts to Java code. For example, it would not be allowed
to have conditional method definitions or method calls in the class
body, except in very specific cases, since we must provide exactly one
complete set of signatures in the Java type.

Other thoughts on this? How should modules map to Java code? Should they
map at all?

What represents packaging?

- Charlie

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


 « Return to Thread: Re: Trying to get jruby classes/methods into java code. (JRuby applet, OGL)