[Grace-core] on equality

Eric Tanter etanter at dcc.uchile.cl
Mon Jul 11 13:15:28 PDT 2011


Hi all,

I just saw a recent post that starts with the following quote:

"We hold these truths to be self-evident, that all objects are created equal, that they are endowed by their Creator with certain unalienable Rights, that among these are sole access to their internal representation"

This reminded me of the (excellent) paper of William Cook (on understanding data abstraction, revisited / onward'09), where he explains his "autognostic principle":

<quote>
To me, the prohibition of inspecting the representation of other objects is one of the defining characteristics of object- oriented programming. I term this the autognostic principle:

An object can only access other objects through their public interfaces.

Autognosis means ‘self knowledge’. An autognostic object can only have detailed knowledge of itself. All other objects are abstract.
The converse is quite useful: any programming model that allows inspection of the representation of more than one abstraction at a time is not object-oriented.
One of the most pure object-oriented programming models yet defined is the Component Object Model (COM) [5, 22]. It enforces all of these principles rigorously. Programming in COM is very flexible and powerful as a result. There is no built-in notion of equality. There is no way to determine if an object is an instance of a given class.
Autognosis has a profound impact on the software engineering properties of a system.
</quote>

So, will Grace be true to this pillar of OOP as described by Cook? I mean, not only through object-level encapsulation, but through not supporting a built-in notion of equality. Will it be possible to check if an object is == (low-level) to another?
The underlying reason (that an object is a set of observations, and that two objects that behave the same should not be distinguishable) is powerful -- but clearly means changing some typical programming idioms...

Cheers,

-- Éric


More information about the Grace-core mailing list