[squeak-dev] Request for feedback: mirrors

Igor Stasenko siguctua at gmail.com
Wed May 23 02:45:50 UTC 2012


On 23 May 2012 03:59, 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?
>
> Colin
>

Nice trick with 188 prim..
yes, actually using this prim you can attach any behavior to any
object, without it's permission..
so why not mirrors ;)

I sure this looks not very good in the eyes of pro-security guys, but
as to me it is fine.
Maybe mirror primitives, mentioned by Eliot is kind of providing the
same but in more conservative/secure way and probably a bit faster.
But unless we ban primitive 188, i don't see why we need something
more/else for mirrors.

And yes, i vote for mirrors.

-- 
Best regards,
Igor Stasenko.


More information about the Squeak-dev mailing list