Some conceptual frameworks
These are some interesting connections between how object oriented code is compiled and how object concepts are described.
I have not tried to describe the fat pointer scheme any way but via a possible implementation.
I suspect that it can be described more abstractly.
- Facetless foundation
- My conceptual framework for object concepts is that an object is bundled behavior and state.
The shape of the represented state and code that defines the behavior must, of course, agree.
A facet to an object Ob may be defined away as merely consisting of a subsidiary wrapper object Os that holds a capability to the original Ob and attenuates or transforms requests and responses while retaining no mutable state itself.
In some systems this extra object layer may be so inexpensive that it is indeed a good implementation.
Java and C++ lack first class facets and this is a fine expedient there.
- Fat Pointer foundation
- Markm advocates the conceptual fat pointer stance.
Most compiled object languages implement an object as a struct which holds the object’s state and also holds a reference to a v-table which is a constant block of code pointers, one for each method defined on that kind of object.
Structs for different objects of the same kind will point to the same v-table.
In this scheme the pointer to the state struct is always bundled with a pointer to the v-table and thus the struct need not locate the behavior table (v-table).
Different facets will have different v-tables and all facets will be on the same footing.
- If I understand the Self language, it also has a struct for each instance and each such struct has the entire gamut of code pointers in the same state struct and furthermore these code pointers need not be constant.
I don’t know how the code pointer slots in this struct are selected.
This may be a good idea but it hurts my head.
I don’t know where it fits in this hierarchy.
I suggest that there is one more kind of fundamental mechanism in the fat pointer scheme as the object and the facet are both fundamental.
The facetless scheme does only with objects, compounding them to explain away facets.
Compounding objects is a necessary technique in any case.
Keykos, at least, follows the facetless conception in that new objects arise by getting the most powerful key to the stateful object and then attenuating it via facets, however implemented.
The controversy is, I think, only about concepts used to explain external object behavior and not implementation techniques.
Markm has made an interesting taxonomy of objects and facets.