<div dir="ltr">Hi all,<div><br></div><div>So far I understood that numbered primitives were there for performance. </div><div><br></div><div>Let&#39;s talk for example of (SmallInteger&gt;&gt;#+). What is the overhead if we have it as a named primitive and not a numbered primitive ? Is there even overhead ?</div><div><br></div><div>Depending on that overhead I would advise for or against the total removal of numbered primitives.</div><div><br></div><div>In any case we should continue to keep a very limited number of them.</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jul 11, 2016 at 7:09 PM, tim Rowledge <span dir="ltr">&lt;<a href="mailto:tim@rowledge.org" target="_blank">tim@rowledge.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
&gt; On 11-07-2016, at 9:59 AM, David T. Lewis &lt;<a href="mailto:lewis@mail.msen.com">lewis@mail.msen.com</a>&gt; wrote:<br>
&gt;<br>
&gt;<br>
&gt; I think that as a general policy, it is best never to add a numbered<br>
&gt; primitive unless there is a specific need to do so. So if you can call the<br>
&gt; primitive by name, then it would be a good idea to roll back the change.<br>
<br>
For a long time I’ve harboured the dream of getting to totally remove the concept of numbered primitives.<br>
<br>
I would posit a simple flag in the compiled method header that says ‘primitive name used here’. That would clue in the VM to do the lookup in the normal named-prim manner. The prim code pointer would be cached appropriately - as it is now - and the Cog would have no special problems with it that I can see.<br>
<br>
To improve the cleverness of the system I’d have a flag somewhere (set via a named prim, of course) that lets the VM know whether to use the default name/module lookup or to give up and  return an error that would then trigger an image side policy to handle the problem. This would allow us to do crazy things like looking at some database/webstie/paper-tape to find out from where to load a plugin and install it. Or generate a new chunk of code to install somehow. And clearly, then retry the failed call if appropriate.<br>
<br>
Clearly, anyone telling the VM they want to take over the prim-call-failure policy would need to know what they are doing. :-J<br>
<br>
tim<br>
--<br>
tim Rowledge; <a href="mailto:tim@rowledge.org">tim@rowledge.org</a>; <a href="http://www.rowledge.org/tim" rel="noreferrer" target="_blank">http://www.rowledge.org/tim</a><br>
Useful random insult:- Proof that evolution CAN go in reverse.<br>
<br>
<br>
</blockquote></div><br></div>