From: MonkeeSage Date: 2008-01-03T11:14:59+09:00 Subject: Re: Where's the bytecode from Ruby 1.9 On Jan 2, 8:35 am, James Dinkel wrote: > Paul Brannan wrote: > > It uses a bytecode representation internally, but doesn't currently > > write the bytecode to disk like python does. > > > The VM::InstructionSequence class gives some access to the bytecode. > > You can get the individual elements of the sequence by calling #to_a. > > > There is support in Nodewrap for saving/restoring instruction sequences, > > but needs to be updated for the latest 1.9. > > > Paul > > Thanks for the reply. There would be some startup-time savings if it > just converted to bytecode once, saved it to disk, and then could be > loaded straight from bytecode, right? Does anyone know if that > functionality is on the horizon? Of course there is a finite amount of > time in a day for the developers to work on ruby, so I have no problem > being patient. I just think ruby may get more business backing if it > can hide it's source code (for those who write closed-source software) > and would also keep people from making a "quick change" to production > code (ie introduce breakage to production code). > > I would guess if it is already converting to bytecode internally than it > is getting some runtime performance benefits from it, and that's where I > personally would rather see the biggest speed improvements anyway. > > James > -- > Posted viahttp://www.ruby-forum.com/. IIRC, before YARV was merged, it had an option to save / load bytecode to / from files. But it's been a year or two and my memory is kind of cloudy. Maybe it was a test or example ruby script that did it rather than YARV core...hmm...can't recall. But if so (either from core or from exposed API), then it seems like a good bet that KRI will be able to do that someday (and like Charlie said, JRuby is already adding support, which will presumably be made binary-compatible with a dump from KRI if / when it's implemented). Regards, Jordan