[squeak-dev] Request for feedback: mirrors
Igor Stasenko
siguctua at gmail.com
Wed May 23 23:54:38 UTC 2012
On 24 May 2012 00:29, Colin Putney <colin at wiresong.com> wrote:
> On Wed, May 23, 2012 at 11:54 AM, Eliot Miranda <eliot.miranda at gmail.com> wrote:
>
>> 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.
>
> You find it clunky because you can't just call the primitive, you have
> to do a manual lookup to find the appropriate CompiledMethod first?
Sorry, but why you need a lookup? Do i miss something? I didn't
checked your implementation.
For instance, Pharo no longer uses shortcut for #class message,
sending a class to an object is a normal message send with usual
lookup procedure.
Therefore , sending #class to an object does not guarantees that it
will answer its class (especially,
if it can be simply not implemented).
Now i don't see where you need to do a manual lookup in following:
(Mirror on: arbitraryObject) subjectClass
Mirror>>subjectClass
^ CompiledMethod receiver: subject withArguments: argArray
executeMethod: answerSubjectClass
(here the subject is an object which mirror reflects).
> Fair enough. I don't think it's an issue with mirrors, because the
> mirror encapsulates that clunky lookup behaviour, and lets us make us
> of it through a clean and simple protocol. I prefer a smaller, more
> general VM/image interface, with as much of the logic as possible in
> the image.
>
> But 188 does have the following practical advantages:
>
> - it's present in older VMs that are already out there
> - in the future we'll be able to make changes at the image level,
> rather than having to ship new VMs
>
> The other thread on your debugger improvements would be moot if they
> had been based on 188 instead of custom primitives.
>
Indeed, i think 188 having a great potential if used by good hands.
>> 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).
>
> Agreed.
>
> Colin
>
--
Best regards,
Igor Stasenko.
More information about the Squeak-dev
mailing list
|