[squeak-dev] Request for feedback: mirrors

Eliot Miranda eliot.miranda at gmail.com
Wed May 23 18:54:31 UTC 2012


On Tue, May 22, 2012 at 6:59 PM, Colin Putney <colin at wiresong.com> wrote:

> On Tue, May 22, 2012 at 3:24 PM, Eliot Miranda <eliot.miranda at gmail.com>
> wrote:
>
> > In part you can use the light-weigth mirror methods in ContextPart, these
> > take the object operated on as an argument.  Non-invasive printing could
> be
> > done via execution simulation.  I've already modified the Squeak
> debugger in
> > Qwaq/Teleplace images to use these light-weight mirror primitives so that
> > messages are not sent to receivers when simulating execution in the
> debugger
> > (i.e. when doing send instead of step).  If the mirror primitives now
> work
> > on the interpreter I can fold this into trunk.  David, do the mirror
> > primitive tests pass on the interpreter?
>
> Yeah, I looked at those, but they seem unnecessary given the existence
> of primitive 188, (i.e., CompiledMethod
> class>>receiver:withArguments:executeMethod:). With that one primitive
> we can do anything we need, with all the logic in the image, instead
> of the VM.
>
> Is there some reason you prefer separate primitives for all these
> operations? You called them light-weight—what do you mean by that?
>
> > Doing this is also a good idea in general since it allows the debugger
> to correctly debug proxies also.
>
> Yes!
>
> I guess we have two separate issues here, which I conflated in my
> first post. On the one hand, there's non-invasive tool support. That
> would be good, and it can be implemented in various ways. Your
> debugger changes sound like a good first step in that direction. We
> could also implement an inspector based on the light-weight mirror
> primitives.
>
> On the other hand, there's the question of a mirror API. That's one of
> the things I really like about the Self-Strongtalk-Newspeak-Dart
> thread of language design, and hey, it would be great to have that in
> Squeak as well. (We stole Morphic from Self, why not mirrors?)
>
> If we did decided to move to a mirror-based API, then non-invasive
> mirrors seems like the way to go, and this approach based on prim 188
> seems like a good way to implement that. This experiment makes me
> think it's feasible. Laying aside the (very real) issues of how to get
> from here to there, is this a direction worth exploring, or is
> Smalltalk-80-style reflection good enough?
>

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're a ways
away from a secure Newspeak-style sandbox).


> Colin
>
>


-- 
best,
Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20120523/7fd434d9/attachment.htm


More information about the Squeak-dev mailing list