From: Rick DeNatale Date: 2009-04-07T05:35:19+09:00 Subject: Re: Running ruby1.9 bytecode --0016361e86c0ffe48b0466e8d863 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On Mon, Apr 6, 2009 at 3:27 PM, Robert Dober wrote: > On Mon, Apr 6, 2009 at 2:48 PM, James Coglan > wrote: > > Hi all, > > > > I just found out about the VM::InstructionSequence.compile method for > > turning Ruby code strings into ruby1.9 bytecode. Is there a standard > method > > of de/serializing this bytecode to/from files, and is there a way of > running > > bytecode directly? I'm looking at generating bytecode from another > language > > to get it to run on Ruby. > Quoting from the Pickaxe book > no, because the bytecode verifier is not ready yet, that seems the > only missing bit. > HTH > Robert > Well that's part of it. But, if by "generating bytecode from another language" means, for instance, executing JVM bytecodes, I don't think it will fly. The term bytecode here is being used rather generically. The YARV "bytecodes" aren't the same as the JVM bytecodes, any more than Smalltalk-80 bytecodes are the same as either. It's like the difference between an Intel and Motorola processor, both have instruction sets with binary representations, but those instruction sets aren't necessarily interchangeable. Getting another language to produce YARV bytecodes would be an exercise for the reader. -- Rick DeNatale Blog: http://talklikeaduck.denhaven2.com/ Twitter: http://twitter.com/RickDeNatale WWR: http://www.workingwithrails.com/person/9021-rick-denatale LinkedIn: http://www.linkedin.com/in/rickdenatale --0016361e86c0ffe48b0466e8d863--