--20cf30780d9e225acc04af86d243
Content-Type: text/plain; charset=ISO-8859-1

Thanks Naruse for answering- I guess the endpoint in some sense would become
more similar to java with distributed bytecodes. I am not sure if you know
the answer to this I do recall a project by MS quite some time back (think I
read about it in a book called Generative Programming) where they had a
system which allowed for reflectiion and manipulation of the compiler- but
what is the motivation for this?

On Tue, Oct 18, 2011 at 9:22 AM, NARUSE, Yui <naruse / airemix.jp> wrote:

> 2011/10/18 Carter Cheng <cartercheng / gmail.com>:
> > bytecode support(does this mean the newer versions of ruby will support
> > fixed bytecodes or will bytecodes be inspectable via the ruby system
> itself)
>
> Ruby 1.9 uses a VM (a.k.a. YARV).
> A given script is parsed and compiled as a bytecode, and runs with the VM.
>
> "Bytecode export" means to support exporting the bytecode, and import
> and run the bytecode.
> It reduces the parse phase and compile phase.
>
> Bytecode inspectation, dissembler for the Ruby VM, is already bundled:
> % ruby -e'puts RubyVM::InstructionSequence.compile(%q[p 1+2]).disasm'
> disasm: <RubyVM::InstructionSequence:<compiled>@<compiled>>> 0000 trace            1                                               (
> 1)
> 0002 putnil
> 0003 putobject        1
> 0005 putobject        2
> 0007 opt_plus         <ic:2>
> 0009 send             :p, 1, nil, 8, <ic:1>
> 0015 leave
>
> > parse trees(it would seem that the current system does have some sort of
> > parse tree system- so does this also mean some sort of inspection
> capability?)
>
> A Ruby interpreter parses a given script and makes a syntax tree,
> but users can't access the tree through a public API.
> This means adding such public API.
>
> > is the current proposal for the gc API a C level api?
>
> C level.
> http://redmine.ruby-lang.org/issues/4990
>
> --
> NARUSE, Yui  <naruse / airemix.jp>
>
>

--20cf30780d9e225acc04af86d243
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Thanks Naruse for answering- I guess the endpoint in some sense would become more similar to java with distributed bytecodes. I am not sure if you know the answer to this I do recall a project by MS quite some time back (think I read about it in a book called Generative Programming) where they had aystem which allowed for reflectiion and manipulation of the compiler- buthat is the motivation for this?<div>
<br><div class="gmail_quote">On Tue, Oct 18, 2011 at 9:22 AM, NARUSE, Yuispan dir="ltr">&lt;naruse / airemix.jp&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
2011/10/18 Carter Cheng &lt;cartercheng / gmail.com&gt;:<br>
<div class="im">&gt; bytecode support(does this mean the newer versions of ruby will support<br>
&gt; fixed bytecodes or will bytecodes be inspectable via the ruby system itself)<br>
<br>
</div>Ruby 1.9 uses a VM (a.k.a. YARV).<br>
A given script is parsed and compiled as a bytecode, and runs with the VM.<br>
<br>
&quot;Bytecode export&quot; means to support exporting the bytecode, and import<br>
and run the bytecode.<br>
It reduces the parse phase and compile phase.<br>
<br>
Bytecode inspectation, dissembler for the Ruby VM, is already bundled:<br>
% ruby -e&#39;puts RubyVM::InstructionSequence.compile(%q[p 1+2]).disasm&#39;<br>
== disasm: &lt;RubyVM::InstructionSequence:&lt;compiled&gt;@&lt;compiled&gt;&gt;==========<br>
0000 trace   ±
0002 putnil<br>
0003 putobject <br>
0005 putobject <br>
0007 opt_plus &lt;ic:2&gt;<br>
0009 send :p, 1, nil, 8, &lt;ic:1&gt;<br>
0015 leave<br>
<div class="im"><br>
&gt; parse trees(it would seem that the current system does have some sort of<br>
&gt; parse tree system- so does this also mean some sort of inspection capability?)<br>
<br>
</div>A Ruby interpreter parses a given script and makes a syntax tree,<br>
but users can&#39;t access the tree through a public API.<br>
This means adding such public API.<br>
<div class="im"><br>
&gt; is the current proposal for the gc API a C level api?<br>
<br>
</div>C level.<br>
<a href="http://redmine.ruby-lang.org/issues/4990" target="_blank">http://redmine.ruby-lang.org/issues/4990</a><br>
<font color="#888888"><br>
--<br>
NARUSE, Yui lt;naruse / airemix.jp&gt;<br>
<br>
</font></blockquote></div><br></div>

--20cf30780d9e225acc04af86d243--