#ReadingNotes
Noble et al. The Left Hand of Equals. Onward! 2016. 13 pages.
What's the simplest possible design for equality in an object-oriented system? The authors range all over from Simula to Smalltalk to Self to Lisp to Java to Scala to object-capability systems like E. Some new to me ideas pop up:
- Autognostic objects: Objects can only look at their own representation, not another's. Smalltalk objects act like this, but not Simula (or Swift!) objects, which encapsulate at the class rather than the object boundary. Interestingly this allows still to ask if another object is identical to yourself, but not generally if an arbitrary object is reference equals to another from the outside. (Though mirror reflection can intentionally pierce this veil.)
- Trust implications of object messaging: left.equals(right) only means anything if we trust left to live up to its contract. This matters for stuff like collection.contains(other), where we trust the collection's contents but not the other object. This is demonstrated in detail in the context of the grant matcher problem from the object capabilities literature.
- Abstract vs Algebraic data types: AbDTs are objects. AlDTs are values whose representation is exposed. These unhelpfully share the same abbreviation as ADTs.
The writing in the first few paragraphs about Simula vs Smalltalk is worth reading just for fun and feel. The quotes from LeGuin's Left Hand of Darkness throughout are also a nice touch.