Compiling to byte codes

Dear all,
I have just compiled and installed 1.9 from SVN trunk. I seem to miss
the
instructions for compiling my ruby script to byte codes. Is there some
documentation available on using the YARV part of 1.9?

Greetings,
JS

Hi,

At Sat, 27 Oct 2007 21:10:53 +0900,
JONNALAGADDA Srinivas wrote in [ruby-talk:276106]:

I have just compiled and installed 1.9 from SVN trunk. I seem to miss the
instructions for compiling my ruby script to byte codes. Is there some
documentation available on using the YARV part of 1.9?

VM::InstructionSequence.new(source_string)

On 10/27/07, Nobuyoshi N. [email protected] wrote:

VM::InstructionSequence.new(source_string)

Thank you very much, it worked. I have also been able to ‘VM::
InstructionSequence.compile_file’ and subsequently ‘eval’ the same. Is
there a way I could dump this to a file, and re-load the same into
another
ruby session?
Greetings,
JS

On Sat, 2007-10-27 at 22:21 +0900, JONNALAGADDA Srinivas wrote:

On 10/27/07, Nobuyoshi N. [email protected] wrote:

VM::InstructionSequence.new(source_string)

Thank you very much, it worked. I have also been able to ‘VM::
InstructionSequence.compile_file’ and subsequently ‘eval’ the same. Is
there a way I could dump this to a file, and re-load the same into another
ruby session?
Greetings,
JS

How about…

File.open(“something”, “w”) do |f|
f.write vm_compiled_stuff
end

later

eval(File.read(“vm_compiled”))

Hi,

At Sat, 27 Oct 2007 22:21:47 +0900,
JONNALAGADDA Srinivas wrote in [ruby-talk:276113]:

Thank you very much, it worked. I have also been able to ‘VM::
InstructionSequence.compile_file’ and subsequently ‘eval’ the same. Is
there a way I could dump this to a file, and re-load the same into another
ruby session?

There are InstructionSequence#to_a and InstructionSequence.load
now, but they will be changed or removed in the near future.

On 10/27/07, Nobuyoshi N. [email protected] wrote:

There are InstructionSequence#to_a and InstructionSequence.load
now, but they will be changed or removed in the near future.

Thank you, again.
Is there a way I can dump the byte codes, to subsequently run them with
something like ‘-y’ flag of jruby?

Or, simply, ship only the byte codes without the source code?

Greetings,
JS