<br><br><div class="gmail_quote">On Thu, May 7, 2009 at 9:36 AM, Igor Stasenko <span dir="ltr">&lt;<a href="mailto:siguctua@gmail.com" target="_blank">siguctua@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">

<br>
2009/5/7 Eliot Miranda &lt;<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</a>&gt;:<br>
<div><div></div><div>&gt;<br>
&gt;<br>
&gt;<br>
&gt; On Thu, May 7, 2009 at 8:44 AM, Bert Freudenberg &lt;<a href="mailto:bert@freudenbergs.de" target="_blank">bert@freudenbergs.de</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; On 07.05.2009, at 17:38, Andreas Raab wrote:<br>
&gt;&gt;<br>
&gt;&gt;&gt; Igor Stasenko wrote:<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; It makes absolutely no sense to say &quot;oh, we&#39;ll all just look it up and then<br>
&gt;&gt;&gt;&gt;&gt; somehow it&#39;s going to magically work&quot;. Version information is *critical* if<br>
&gt;&gt;&gt;&gt;&gt; you want to play things together in the long term - it has allowed us to<br>
&gt;&gt;&gt;&gt;&gt; have a very smooth ride for a very long time in this area and I wish Squeak<br>
&gt;&gt;&gt;&gt;&gt; would have more of that in general.<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Taking a function pointer by name, is nothing more than enumerating<br>
&gt;&gt;&gt;&gt; the VM capabilities.<br>
&gt;&gt;&gt;&gt; Take a look at OpenGL extension mechanism. Do they have to change the<br>
&gt;&gt;&gt;&gt; version of OpenGL each time they want to add new functionality? No.<br>
&gt;&gt;&gt;&gt; You can simply ask the library about support of certain capability -<br>
&gt;&gt;&gt;&gt; and depending on answer decide what to do.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Yes, OpenGL is a great example. Because what the OpenGL consortium does is moving extensions into core functionality, increasing the version number of OpenGL so that clients know they can rely on a documented and stable API. Exactly my point.<br>


&gt;&gt;&gt;<br>
&gt;&gt;&gt; I have no problems with a named lookup mechanism in addition to a core interface. In fact we have one, it&#39;s ioLoadFunctionFrom. It solves a useful problem, namely that of how to support entry points where you don&#39;t know whether they will be available in the future or if it&#39;s only for use in this one version. But it&#39;s not a replacement for a documented core API.<br>


&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; +1<br>
&gt;&gt;<br>
&gt;&gt; But back to the original question - do we want to change the plugin API for 4.0 VMs?<br>
&gt;<br>
&gt; Yes.  I propose the following changes:<br>
&gt; - change the interface to the API to one based on function pointers, not interpreterProxy.  The function pointers are initialized in a plugin&#39;s setInterpreter: which does the traditional compatibility check and then fetches the function pointers from the argument (exactly how we can discuss further).<br>


&gt; - remove stack access from the API, writing them as SmartSyntaxPlugins where arguments are passed in as parameters, returning the result on success and 0 (not SmallInteger 0) on failure<br>
&gt; - eliminate pushRemappableOop/popRemappableOop and make the allocation interface one that can fail, so when memory runs out a primitive will return an out-of-memory error code<br>
&gt; - use primitive error codes where appropriate.  e.g. in a plugin<br>
&gt;     ^self primitiveFailFor: PrimErrNoMem<br>
&gt; is equivalent to<br>
&gt;     primErrorCode = 0 ifTrue: [primErrCode := PrimErrNoMem].<br>
&gt;     ^nil<br>
&gt; - provide isImmediateObject: and use it in place of isIntegerObject: when the objective is to select heap objects.  Use isCharacterObject: when the objective is to select a character. I intend to add immediate characters within the next few months.<br>


&gt;<br>
</div></div>so, does that means that you will extend the oop tag to 2 bits (or more)?</blockquote><div><br></div><div>Yes.  Keep 31-bit SmallIntegers, provide e.g. 24-bit immediate characters.  Andreas wrote a <a href="http://lists.squeakfoundation.org/pipermail/vm-dev/2006-January/000429.html">thorough sketch of this scheme</a> in 2006.</div>

<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Or just reserve a non-movable heap space for character objects, like:<br>
isCharacterObject: oop<br>
 ^ oop &gt;= charsStart and: [ oop &lt; charsEnd ]</blockquote><div><br></div><div>No. This doesn&#39;t scale to unicode.  The tagged approach provides much faster string access, and identity comparison for all characters, not just the byte range.</div>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; - Bert -<br>
<div><div></div><div>&gt;&gt;<br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
<br>
<br>
<br>
--<br>
Best regards,<br>
Igor Stasenko AKA sig.<br>
</div></div></blockquote></div><br>