<div dir="ltr"><br><br><div class="gmail_quote">On Fri, Sep 5, 2008 at 1:30 PM, Stephen Pair <span dir="ltr">&lt;<a href="mailto:stephen@pairhome.net">stephen@pairhome.net</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div dir="ltr"><div class="Ih2E3d"><div class="gmail_quote">On Fri, Sep 5, 2008 at 3:17 PM, David Griswold <span dir="ltr">&lt;<a href="mailto:david.griswold.256@gmail.com" target="_blank">david.griswold.256@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div class="gmail_quote"><div><br>Yes, it&#39;s becoming clear that V8 doesn&#39;t do anything that radically new or magical, and that it was specifically designed for JavaScript, not as any kind of universal dynamic language VM.&nbsp; I&#39;m especially disappointed at Eliot&#39;s observation that it doesn&#39;t have a bytecode intermediate form, although they may do mixed-mode execution by first interpreting the AST.<br>

</div></div></div></blockquote></div><br></div><div>Why is that a bad thing? &nbsp;I actually thought that was one of the most interesting aspects. &nbsp;Bytecodes can provide you a concise portable format, but you could also do that by compressing or otherwise condensing source code (which I guess one way of condensing is to map to bytecode). &nbsp;I&#39;m not saying bytecodes wouldn&#39;t be desirable, but there&#39;s something appealing (to me) about a direct translation from source to machine code and I&#39;m curious what other advantages bytecodes might have.</div>

<div><br></div><div>Also, in a really pure OO VM and language, what would the bytecode set reduce to? &nbsp;Three instructions? &nbsp;push, pop and send?</div></div></blockquote><div><br></div><div>push arg/temp</div><div>pop-store temp</div>
<div>push literal</div><div>push self</div><div>pop</div><div>dup</div><div>return top</div><div>block return top</div><div>send</div><div>send super/outer et al</div><div>push inst var &nbsp; &nbsp; &nbsp; (still need this even though it is only used in accessors)</div>
<div>pop-store inst var (ditto)</div><div><br></div><div>plus some form of closure support, e.g.</div>create block<div>push new array</div><div>push non-local temp</div><div>pop-store non-local temp</div><div><br></div><div>
which is not much fewer than there are now. &nbsp;Don&#39;t confuse encoding with semantics. &nbsp;My Squeak compiler (heavily derivative of the current Squeak compiler) currently has 34 opcodes distributed over 253 bytecodes. &nbsp;Of these, 7 are for optimizations other than inlining blocks, so reduce to 27. &nbsp;That&#39;s essentially twice as many as the list above which you get by dropping direct access to literals.</div>
<div><br></div><div>The number of opcodes for a pure OO language is around 15, slightly more than 3 :)</div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div dir="ltr"><div></div><div><br></div><font color="#888888"><div>- Stephen</div></font></div>
<br><br>
<br></blockquote></div><br></div>