<br><br><div class="gmail_quote">On Tue, May 22, 2012 at 6:59 PM, Colin Putney <span dir="ltr">&lt;<a href="mailto:colin@wiresong.com" target="_blank">colin@wiresong.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 class="im">On Tue, May 22, 2012 at 3:24 PM, Eliot Miranda &lt;<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>&gt; wrote:<br>
<br>
&gt; In part you can use the light-weigth mirror methods in ContextPart, these<br>
&gt; take the object operated on as an argument.  Non-invasive printing could be<br>
&gt; done via execution simulation.  I&#39;ve already modified the Squeak debugger in<br>
&gt; Qwaq/Teleplace images to use these light-weight mirror primitives so that<br>
&gt; messages are not sent to receivers when simulating execution in the debugger<br>
&gt; (i.e. when doing send instead of step).  If the mirror primitives now work<br>
&gt; on the interpreter I can fold this into trunk.  David, do the mirror<br>
&gt; primitive tests pass on the interpreter?<br>
<br>
</div>Yeah, I looked at those, but they seem unnecessary given the existence<br>
of primitive 188, (i.e., CompiledMethod<br>
class&gt;&gt;receiver:withArguments:executeMethod:). With that one primitive<br>
we can do anything we need, with all the logic in the image, instead<br>
of the VM.<br>
<br>
Is there some reason you prefer separate primitives for all these<br>
operations? You called them light-weight—what do you mean by that?<br>
<div class="im"><br>
&gt; Doing this is also a good idea in general since it allows the debugger to correctly debug proxies also.<br>
<br>
</div>Yes!<br>
<br>
I guess we have two separate issues here, which I conflated in my<br>
first post. On the one hand, there&#39;s non-invasive tool support. That<br>
would be good, and it can be implemented in various ways. Your<br>
debugger changes sound like a good first step in that direction. We<br>
could also implement an inspector based on the light-weight mirror<br>
primitives.<br>
<br>
On the other hand, there&#39;s the question of a mirror API. That&#39;s one of<br>
the things I really like about the Self-Strongtalk-Newspeak-Dart<br>
thread of language design, and hey, it would be great to have that in<br>
Squeak as well. (We stole Morphic from Self, why not mirrors?)<br>
<br>
If we did decided to move to a mirror-based API, then non-invasive<br>
mirrors seems like the way to go, and this approach based on prim 188<br>
seems like a good way to implement that. This experiment makes me<br>
think it&#39;s feasible. Laying aside the (very real) issues of how to get<br>
from here to there, is this a direction worth exploring, or is<br>
Smalltalk-80-style reflection good enough?<br></blockquote><div><br></div><div>To not address your core questions, use of 188 is I think clunky.  Instead, implementing the mirror primitives in the mirrors seems simple and efficient.  Putting the mirror primitives in ContextPart is insecure, since anyone can to thisContext object: foo instVarAt: n.  But fixing this means a major design overhaul of the system re debugging and mirrors, so it can stand for now.  (After all anyone can do instVarAt: now, so we&#39;re a ways away from a secure Newspeak-style sandbox).</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class="HOEnZb"><font color="#888888"><br>
Colin<br>
<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>best,<div>Eliot</div><br>