[squeak-dev] The Inbox: Tools-ct.1101.mcz

Marcel Taeumel marcel.taeumel at hpi.de
Wed Jan 12 08:10:54 UTC 2022


Hi Chris, hi all --

> CollectionInspector is used for Magma's large MagmaCollections, which require a db access to retrieve the size

CollectionInspector is optimized for Smalltalk collections. That's the only thing we can guarantee. If Magma collections require a modification, then Magma can make an extension or offer its own Magma-specific inspectors. Yet, it makes sense to always look out for such external projects to not break compatibility without reason. I would say that #size being an expensive operation on a collection is quite surprising and thus not foreseeable in general.

Currently the default Inspector should not be used to look behind proxies. That's what the BasicInspector is for. If a proxy mimics morphs, than that normal inspector for such proxies should also be a MorphInspector. And so on.

Best,
Marcel
Am 12.01.2022 00:52:20 schrieb Chris Muller <ma.chris.m at gmail.com>:
Hi Christoph, 
I am not sure whether we can (or should) make the default inspector proxy-safe. Rather, IMHO the default inspectors should handle proxies transparently and display the underlying object.

For inspecting the implementation details of proxies, we have the BasicInspector, which is almost completely proxy-safe (the only exception I am aware of is a send to #isReadOnlyObject for the window label, for which we currently do not have a mirror primitive).
Yes, in principle, it's impossible to argue against that.  "Backward-compatibility" for Magma is all I've got. 
> #size is a provoking message.

And #printString, #longPrintString, #perform:, #instVarNamed:, #basicSize, and all others existing sends are not? :-)
They are, but not invoked until you interact with the Inspector.  Putting the #size in the title bar changes that behavior.


Also, it may be presumptuous to assume the collection being inspected is a SmalltalkCollection.  CollectionInspector is used for Magma's large MagmaCollections, which require a db access to retrieve the size..
> Magma's Proxy's anyway (which don't use the mirror-primitives but the old-school Proxy pattern)
Just out of interest, how would you implement a proxy using mirror primitives? :-)
I'm not sure, but Eliot says it's the way Proxy's are supposed to be done in Squeak so that ProtoObject can have no methods.

Unfortunately, it would require rewriting a lot of low-level methods like Symbol>>#=  to be (to my knowledge) non-standard Smalltalk which, realistically, is not ever going to be done, and therefore I'm doubtful the dream of "transparent proxies" will ever, uh, materialize (no pun intended!  :)  ), which is unfortunate because that "dream" continues to be a Magma-killer (slowly by a thousand cuts).  Magma's Proxy's have worked well-enough for *applications* for many years, but lately developers seem to want "clean", "transparent" proxies and so even the standard old-school Gang-of-Four Proxy pattern remains broken since 5.3.

I hope I'm missing something and completely wrong about the above, but I don't think I am.  I admit I haven't had the time or inclination to try to re-inventing Magma's proxy system just to accommodate some abstract notions of purity.  I'm concerned with application of computer code to external, real-world purposes.

 - Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20220112/0824417f/attachment.html>


More information about the Squeak-dev mailing list