<body><div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000;text-align: left" dir="ltr">
                                        > <span style="font-family: Calibri, Helvetica, sans-serif;font-size: 16px">what do you mean?</span><div><span style="font-family: Calibri, Helvetica, sans-serif;font-size: 16px"><br></span></div><div><span style="font-family: Calibri, Helvetica, sans-serif;font-size: 16px">Mirror primitives exist because of proxies and why ProtoObject exist.</span></div><div><span style="font-family: Calibri, Helvetica, sans-serif;font-size: 16px"><br></span></div><div><span style="font-family: Calibri, Helvetica, sans-serif;font-size: 16px">Best,</span></div><div><span style="font-family: Calibri, Helvetica, sans-serif;font-size: 16px">Marcel</span></div><div class="mb_sig"></div><blockquote class='history_container' type='cite' style='border-left-style:solid;border-width:1px; margin-top:20px; margin-left:0px;padding-left:10px;'>
                        <p style='color: #AAAAAA; margin-top: 10px;'>Am 12.01.2022 14:03:32 schrieb Thiede, Christoph <christoph.thiede@student.hpi.uni-potsdam.de>:</p><div style='font-family:Arial,Helvetica,sans-serif'>

<div id="divtagdefaultwrapper" style="font-size: 12pt;color: #000000;font-family: Calibri,Helvetica,sans-serif" dir="ltr">
<p>Hi Marcel,</p>
<p><br>
</p>
<p>> <span>This discussion looks like it affects our current ProtoObject/Proxy situation.</span></p>
<p><span><br>
</span></p>
<p><span>Not really, I think. I'm not proposing to change the dynamic forwarding pattern, what do you mean?</span></p>
<p><span><br>
</span></p>
<p><span>> <span>maybe move those mirror primitives to ProtoObject?</span></span></p>
<p><span><br>
</span></p>
<p><span>Is your proposal to redefine #at: & Co. on ProtoObject under a different name, e.g., ProtoObject >> #mirrorAt:?</span></p>
<p><span><br>
</span></p>
<p><span>Technically, from my understanding, it would not a mirror primitive method in this case, just a normal primitive method. However, we probably could do this, but I am not sure why we should do this. The goal of these methods would be that no subclass
 ever overrides them, so we would not benefit from message dispatching. But it would keep us from reaching an empty ProtoObject class, which also means that subclasses are unnecessarily restricted in their freedom of having full control about the understood
 protocol.</span></p>
<p><span><br>
</span></p>
<p><span>Am I missing a point or would #mirrorAt: just be syntactical sugar in comparison to a mirror primitive method? As for the performance, a mirror primitive method requires an additional bytecode step (push) whereas #mirrroAt: might be a little bit slower
 in terms of method lookup, but I suppose modern VMs are good at optimizing this.</span></p>
<p><span><br>
</span></p>
<p><span>> <span>Maybe class side?</span></span></p>
<p><span><span><br>
</span></span></p>
<p><span><span>Do you mean "ProtoObject class >> #objectAt:" etc.? Sure, we could do ... I'm not absolutely sure what makes ProtoObject class the right place for this, but sounds good. :-)</span></span></p>
<p><span><span><br>
</span></span></p>
<p><span><span>Best,</span></span></p>
<p><span><span>Christoph</span></span></p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><span style="font-family: Calibri, sans-serif;color: #000000"><b>Von:</b> Squeak-dev <squeak-dev-bounces@lists.squeakfoundation.org> im Auftrag von Taeumel, Marcel<br>
<b>Gesendet:</b> Mittwoch, 12. Januar 2022 09:35:45<br>
<b>An:</b> squeak-dev<br>
<b>Betreff:</b> Re: [squeak-dev] Do we need to provide the mirror primitive on Context (only)?</span>
<div> </div>
</div>
<div>
<div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000;text-align: left" dir="ltr">
Hi Christoph --
<div><br>
</div>
<div>This discussion looks like it affects our current ProtoObject/Proxy situation. So ... maybe move those mirror primitives to ProtoObject? Maybe class side?</div>
<div><br>
</div>
<div>Best,</div>
<div>Marcel</div>
<div class="mb_sig"></div>
<blockquote class="history_container" type="cite" style="border-left-style:solid;border-width:1px; margin-top:20px; margin-left:0px;padding-left:10px;">
<p style="color: #AAAAAA; margin-top: 10px;">Am 11.01.2022 22:52:36 schrieb Thiede, Christoph <christoph.thiede@student.hpi.uni-potsdam.de>:</p>
<div style="font-family:Arial,Helvetica,sans-serif">
<div id="divtagdefaultwrapper" style="font-size: 12pt;color: #000000;font-family: Calibri,Helvetica,sans-serif" dir="ltr">
<p>Hi Eliot, hi all,</p>
<p><br>
</p>
<p>as I have learned from your great explanation about stack frame states and marriage last year, using "thisContext" in your code is more expensive than one might assume naively when thinking of it as a simple variable. This also means that using "thisContext"
 for invoking a mirror primitive is (unnecessarily?) slow:</p>
<p><br>
</p>
<p></p>
<p style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;font-size: 16px">
</p>
<div><span style="font-size: 12pt">[thisContext object: World eqeq: World] bench. '28,000,000 per second. 35.8 nanoseconds per run. 19.13235 % GC time.' </span></div>
<div><span style="font-size: 12pt"><br>
</span></div>
<p></p>
<div id="Signature" style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;font-size: 16px">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size: 12pt">
<div name="divtagdefaultwrapper" style="font-family: Calibri, Arial, Helvetica, sans-serif; margin: 0px;">
<div></div>
</div>
</div>
</div>
versus:
<p></p>
<p><br>
</p>
<p></p>
<div><span style="font-size: 12pt">
<div>TestObject >> object: anObject eqeq: anOtherObject </div>
<div><span style="font-size: 12pt;white-space: pre"></span><span style="font-size: 12pt"><primitive: 110></span><br>
</div>
<div><span style="white-space:pre"></span>self primitiveFailed</div>
</span></div>
<div><span style="font-size: 12pt"><br>
</span></div>
<div><span style="font-size: 12pt">
<div style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;font-size: 16px">
obj := TestObject new.</div>
<div style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;font-size: 16px">
[obj object: World eqeq: World] bench '58,900,000 per second. 17 nanoseconds per run. 0 % GC time.' </div>
<div><br>
Twice as fast!</div>
<div><br>
</div>
<div>I am wondering whether it would be useful to copy or move the mirror primitive protocol to another place, maybe on the class-side of Context, given the number of senders to some mirror primitive methods which are different from Context. In particular,
 SimulationStudio makes <a href="https://sourcegraph.com/search?q=context:global+thisContext+object+repo:LinqLover/SimulationStudio&patternType=literal" class="OWAAutoLink" title="https://sourcegraph.com/search?q=context:global+thisContext+object+repo:LinqLover/SimulationStudio&amp;patternType=literal
Strg+Klicken oder tippen Sie, um dem Link zu folgen.">
heavy</a> use of them, but the BasicInspector, Squot, and some other tools use it, too. :-)</div>
<div><br>
</div>
<div>So here are my questions:</div>
<div>
<ul style="margin-bottom: 0px; margin-top: 0px;">
<li>Would this be a legitimate use of the mirror primitives or is the (implicit) contract that the receiver must be a context instance or even a context instance on the current stack?</li><li>Do you consider the mirror primitive protocol a public protocol or are all senders from different classes actually abusing the protocol?</li><li>How would you think about moving this protocol to a static place such as Context class?</li></ul>
<div><br>
</div>
</div>
<div>Thanks in advance!</div>
<div><br>
</div>
<div>Best,</div>
<div>Christoph</div>
</span></div>
<p></p>
<div id="Signature">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size: 12pt;color: rgb(0, 0, 0);font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols">
<div name="divtagdefaultwrapper" style="font-family: Calibri,Arial,Helvetica,sans-serif;font-size: ;margin: 0">
<div><span style="font-size: 10pt;color: #808080"></span></div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div></blockquote>
                                        </div></body>