[squeak-dev] Mirror primitives

Eliot Miranda eliot.miranda at gmail.com
Mon Sep 7 19:29:16 UTC 2009


On Mon, Sep 7, 2009 at 12:19 PM, Bert Freudenberg<bert at freudenbergs.de> wrote:
> On 07.09.2009, at 20:56, Eliot Miranda wrote:
>>
>> I have fixes for this integrated in Qwaq.  This is work I did for
>> VisualWorks a while back.  The idea is to add a set of mirror
>> primitives, so called because they do reflection, to ContextPart.
>> These primitives implement the basic operations of the object model
>> needed for execution simulation, fetching an object's class, accessing
>> its named and indexed instance variables, and the number of indexed
>> instance variables, sending a message, but they take the object
>> operated on as a parameter and so do function without sending messages
>> to that object.
>
> Wouldn't that break encapsulation in a way we never had to before?

If one dared use those primitives for anything other than simulating
the VM then I suppose they're a little worse than instVarAt:put: and
basicAt:put:, but not so much.  I think it is much more dangerous to
have a debugger that appears to be correct but breaks one's code in
ways that are horribly difficult to understand.

Note that both Self and Newspeak (and VisualWorks) take the mirror
primitive approach.  But there is certainly a security issue and one
wants to medate access to the mirror primitives carefully.

>
> - Bert -
>
>
>
>



More information about the Squeak-dev mailing list