Hi!

Of course, going directly to byte code should be simpler. There is nothing really comlicated with Java byte code. On the other hand, mapping each Ruby construct to the specific JRuby Java code would probably be simpler to map out by first trying it out by generating source code. I'm not suggesting as a delivery model, of course,
but just as a first step to use so we can directly go to byte code later.

Another issue to think about is Ruby 2.0 and Rite. As far as I can understand Rite will be a real virtual machine with Ruby byte codes too.

/O


At 13:35 2006-04-11, you wrote:
Ola Bini wrote:
> It seems to me that a first step for this would be to have the current
> parser output Java source code, which uses JRuby internals to create
> Ruby-classes in the way the builtin classes are defined right now (like
> RubyString and RubyTime, etc). It really doesn't seem that hard to output
> that kind of code, or am I missing something deep here?

Hi all,

I did an attempt to do this a few years ago, with essentially this
approach. The major difference would be that I generated JVM bytecode
directly, instead of going through Java source code. This enables much
faster compilation, but may have added some complexity to it. But
generating source code isn't exactly a "clean" solution either and JVM
bytecode is surprisingly simple.
If I recall correctly, I defined a kind of intermediate byte-code,
essentially the parse-tree nodes flattened, and then compiled those into
JVM bytecode. Using YARV's byte-code definitions for this could be an
interesting approach.

So in short, no, it isn't that hard, but it's a kind of big task to go
through every kind of parse-tree node and write the code for it.

/Anders




-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Jruby-devel mailing list
Jruby-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jruby-devel





-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Jruby-devel mailing list
Jruby-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jruby-devel

Reply via email to