Open, Extensible Object Models

Programming languages often hide their implementation at a level of abstraction that is inaccessible to programmers. Decisions and tradeoffs made by the language designer at this level (single vs. multiple inheritance, mixins vs. Traits, dynamic dispatch vs. static case analysis, etc.) cannot be repaired easily by the programmer when they prove inconvenient or inadequate. The artificial distinction between implementation language and end-user language can be eliminated by implementing the language using only end-user objects and messages, making the implementation accessible for arbitrary modification by programmers. We show that three object types and five methods are sufficient to bootstrap an extensible object model and messaging semantics that are described entirely in terms of those same objects and messages. Raising the implementation to the programmers’ level lets them design and control their own implementation mechanisms in which to express concise solutions and frees the original language designer from ever having to say “I’m sorry”.

~

PIUMARTA, Ian and WARTH, Alessandro, 2008. Open, Extensible Object Models. In: HIRSCHFELD, Robert and ROSE, Kim (eds.), Self-Sustaining Systems. Berlin, Heidelberg: Springer Berlin Heidelberg. p. 1–30. Lecture Notes in Computer Science. ISBN 978-3-540-89274-8. p. 4–5.

For our Lisp-like language we might have a length primitive that tells us how many elements are present in a string or list. Using the tag field in the Object structure to discriminate the type of payload, length might look like this: …