From: Bill Kelly Date: 2001-04-18T08:14:13+09:00 Subject: [ruby-talk:13783] Re: Ruby on a JVM - good or bad idea? From: "Stefan Matthias Aust" > > On Tue, 17 Apr 2001 14:47:20 +0900, "Bill Kelly" > wrote: > > >[...] > >Sounds like a job for a C-to-Java translator? ;-) > > Don't think so. The only one I know (from Novocode) creates code > which you never want to look at or even maintain. IIRC, it creates > its own memory with int arrays to simulate C pointer and other stuff, > Java cannot handle. Ah. Well I admit it may be a silly idea. But what I'd envisioned was some sort of "end run" around the problem, where--IF you had a C-to-Java translator that was good enough--you could keep the original Ruby source always in C. Minor mods to the C code being the idea, a compilation flag here and there - something that (in theory) could be simple enough to win consideration for inclusion and maintenance in the master Ruby sources. So, when you want to compile the Java version of Ruby, the master C source code is run through an automated translation stage, and compiled with a Java compiler. . . . Yes, I know, that while technically possible, it may not be feasible. . . . I mean, for that matter, GCC as I recall has an experimental Java bytecode backend. At least I seem to recall seeing such a thing a couple years ago in the GCC docs. . . . I wonder, I wonder . . . ;) > >Seriously, though - anyone think that could be workable? Ruby's VM > >running on Java's VM? Brute-force-like? > > Has ruby an intermediate form like for example byte codes or a > precompiled token stream which is then interpretered by something like > a Ruby VM? If this is the case, then recreating this RVM in Java > might be the fasted way to have ruby code running on a JVM. I agree, but I don't know the answer. Regards, Bill