<div dir="ltr">Hi Stefan,<br><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jan 14, 2014 at 4:37 AM, Stefan Marr <span dir="ltr">&lt;<a href="mailto:smalltalk@stefan-marr.de" target="_blank">smalltalk@stefan-marr.de</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Bert:<br>
<br>
On 14 Jan 2014, at 12:07, Bert Freudenberg &lt;<a href="mailto:bert@freudenbergs.de">bert@freudenbergs.de</a>&gt; wrote:<br>
<br>
&gt; (moving to vm-dev)<br>
Thanks!<br>
<br>
[careful, rather academic discussion ahead]<br>
<div class="im"><br>
&gt; On 14.01.2014, at 10:56, Stefan Marr &lt;<a href="mailto:smalltalk@stefan-marr.de">smalltalk@stefan-marr.de</a>&gt; wrote:<br>
&gt;<br>
</div><div class="im">&gt;&gt; I am just trying to think of how to implement that in the SOM VMs.<br>
&gt;&gt; Without GC support for tracing/enumerating the objects, it’s not going to be pretty.<br>
&gt;&gt;<br>
&gt;&gt; #someObject/#nextObject don’t make any sense for me in the long term.<br>
&gt;<br>
&gt; Some VMs support those easily and they&#39;re more efficient, so I would not abandon them. But, as I wrote before, I’d make them optional, if a VM instead provides allObjects.<br>
<br>
</div>Yes, right. But I was thinking out loud about SOM. So, I don’t have backward compatibility issues.<br>
Depending on the personal point of view, one might even argue that SOM is not actually a Smalltalk, because it does not provide all the fancy things like thisContext, or #become:.<br>
<div class="im"><br>
&gt;&gt; I want to support one form or another of parallel execution. So, if I want to offer #allObjects at all, it needs to be an atomic snapshot. Most likely with stop-the-world semantics, which is a severe burden on performance.<br>

&gt;<br>
&gt; Sure, but then allObjects shouldn&#39;t be used in production code anyway. Users need to be aware that it’s going to be slow.<br>
<br>
</div>Yes, I guess that’s the way to go.<br>
<div class="im"><br>
&gt; You need to traverse from specialObjectsArray and activeContext. This will find all objects.<br>
</div><div class="im">&gt; But if you support thisContext then you must have those mechanisms in place already.<br>
<br>
</div>Well, that’s the thing. I don’t support thisContext. thisContext is to my understanding really bound to one specific implementation technique. Thereby restricting significantly how a VM can implement the language.<br>

I am also not yet sure whether I will provide some replacement for thisContext, but if so, it would need to be a much more specific interface that reifies information from the execution context explicitly on demand only.</blockquote>
<div><br></div><div>I don&#39;t see the difference.  In my VMs contexts are only created on demand.  The issue is what kind of object proxy to provide for execution context.  In VisualAge there is a proxy for a stack segment, essentially a pointer, and the VI must construct stack frames from this.  In Cog there is a context which contains a hidden pointer to a single stack frame.  Then there are facilities for manipulating the underlying stack through those interfaces.  In VisualAge I guess one can rewrite the stack arbitrarily.  In Cog, assignments to the sender, pc, stack pointer, etc are supported in the VM by manipulating the underlying stack appropriately.  In both cases a context-like object is adequate.  I also think that a context-like object is an appropriate proxy for a non-stack-like execution model such as continuation-passing.  So viewd from this level of abstraction I think it makes no difference, and hence you might as well provide thisCOntext.  You might disallow assigning to the sender in your implementation, but I don&#39;t see how thisContext per se severely constrains your implementation; it&#39;s just about where in the system (in the image or in the VM) the mapping from the activation proxy to the underlying execution context is done.</div>
<div><br></div><div>Does this make sense?</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> And since the various SOM implementations with classic approaches in C/C++, using RPython ala PyPy, and using Truffle on top of the JVM all differ significantly, it is for me a nice academic exercise to find an interface that just provides the desired functionality without restricting the implementation too much.<br>

<div class="HOEnZb"><div class="h5"><br>
Best regards<br>
Stefan<br>
<br>
--<br>
Stefan Marr<br>
INRIA Lille - Nord Europe<br>
<a href="http://stefan-marr.de/research/" target="_blank">http://stefan-marr.de/research/</a><br></div></div></blockquote></div>-- <br>best,<div>Eliot</div>
</div></div>