<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">2016-02-15 19:34 GMT+01:00 Eliot Miranda <span dir="ltr"><<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> <br><div dir="ltr">Hi Stef,<div class="gmail_extra"><br><div class="gmail_quote">On Mon, Feb 15, 2016 at 8:18 AM, stepharo <span dir="ltr"><<a href="mailto:stepharo@free.fr" target="_blank">stepharo@free.fr</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
Hi eliot<br>
<br>
I think that the difference is really what guillermo explained. <br>
With DNU you can only trapped methods that are not defined while if
you want to implement true proxy you do not want holes.<br>
I think that also with DNU proxy there were some limits realyed to
classe but I do not remember.<br></div></blockquote><div><br></div><div>As far as the VM goes, there is /one/ minor issue with special selector #== and #class (*). But the real issue is that ProtoObject implements far too much protocol. If one creates a class that inherits from nil all it needs to do is implement doersNotUnderstand: and it will catch every message (*). For this to work the debugger and basic inspectors must use the mirror primitives otherwise there will be infinite recursion of MNUs.</div><div><br></div><div>Now the issue with special selector #== and #class is that these bytecodes are specified as no lookup. So if one uses bytecodes 182 (#==) or 199 (#class) these operate without sending messages and will compare the object or answer the object's class without sending #doesNotUnderstand:.</div><div><br></div><div>In the VW VM I added a flag so one could turn this behaviour off, and that's certainly easy to do in our VM. Another approach is to have the bytecode compiler not send these.</div><div><br></div><div>But given our VM it is certainly possible to use doesNotUnderstand: proxies, using a much slimmer class than ProtoObject. In fact a good project would be to try and shrink ProtoObject until it provides the minimum, which would be a #doesNotUnderstand: method that raises an error that reminds the programmer that they need to implement their own doesNotUnderstand: handler in subclasses of ProtoObject.</div><div> </div></div></div></div></blockquote><div>Hello,</div><div><br></div><div>The #class primitive bytecode is not used in Pharo to avoid this kind of problem.</div><div><br></div><div>It is indeed possible to add a setting in Opal compiler not to compile #== using the inlined selector to avoid issues there too. However, even in proxies, it may make sense to have this inlined selector.</div><div><br></div><div><br></div><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div bgcolor="#FFFFFF" text="#000000">
<br>
Stef<br>
<br>
<div>Le 15/2/16 16:06, Eliot Miranda a
écrit :<br>
</div><div><div>
<blockquote type="cite">
<div>Hi Denis,</div>
<div><br>
On Feb 15, 2016, at 6:53 AM, Denis Kudriashov <<a href="mailto:dionisiydk@gmail.com" target="_blank"></a><a href="mailto:dionisiydk@gmail.com" target="_blank">dionisiydk@gmail.com</a>>
wrote:<br>
<br>
</div>
<blockquote type="cite">
<div>
<div dir="ltr">
<div class="gmail_extra"><br>
<div class="gmail_quote">2016-02-15 15:32 GMT+01:00
Mariano Martinez Peck <span dir="ltr"><<a href="mailto:marianopeck@gmail.com" target="_blank"></a><a href="mailto:marianopeck@gmail.com" target="_blank">marianopeck@gmail.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>As far as I can remember (this was about 4 years
ago) The use of #cannotInterpret: was the only way
to be able to intercept everything without breaking
the system. Subclassing from ProtoObject make your
proxy to understand some messages. Subclassing from
nil was technically possible, but I found out the
system would simply crash as it didn't know at all
how to handle other subclasses of nil. Even with the
debugging support I added as you can read in the
paper. Maybe things have changed.</div>
<div><br>
</div>
<div>If subclassing from nil does not break the system
and you can still inspect, debug proxies, then sure,
you can give a try to Ghost using #dnu rather than
#cannotInterpret:. In fact, I would like to have a
dnu-based approeach that is as reliable as it was
#cannotInterpret: in the sense of how much I can
intercept. With #cannotInterpret I could trap
EVERYTHING (everything but #==) and then decide what
to do. Subclassing from nil would get you there too
if you make it work. </div>
</blockquote>
</div>
<br>
Actually I already implemented it many yeas ago for
Mocketry. But subclassing from nil works correctly only in
VW. I got problems when porting it to Squeak (at that
time). </div>
<div class="gmail_extra">Now I want to give DNU another
chance. It will simplify logic very much. It will remove
strange hierarchy of proxies which is needed for trick but
raises many questions.</div>
</div>
</div>
</blockquote>
<br>
<div>There is no reason in principle why Squeak/Pharo should not
be able to use MNU proxies in the same way as VW. The key is
to <span style="background-color:rgba(255,255,255,0)">use
the mirror primitives in</span> basic inspectors that are used
to inspect the proxies and in the debugger to simulate code.
Without<span style="background-color:rgba(255,255,255,0)"> the
mirror primitives many sends to a proxy are likely to create
an infinite recursion. As yet we don't have a robust low
space handler that catches infinite recursion so debugging can
be frustrating. But we can work on this. IMO the MNU
approach is to be preferred.</span></div>
</blockquote>
<br>
</div></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div>
</div></div>
<br></blockquote></div><br></div></div>