fare / projects

Various projects you might work on
5 stars 0 forks source link

A compositional MOP for Prototype Inheritance #7

Open fare opened 4 years ago

fare commented 4 years ago

Prototype inheritance can beautifully express the incremental specification of computations in a branching structure of information elements. The basic principle of it can be simply defined in a hundred characters of Scheme (see issue #3), with two functions: one to compute the fixed point of an open recursion scheme (or prototype), the second to chain two open recursion schemes through inheritance. However, that simple reduction is lacking in features, whereas adding those features in a naive ad-hoc ways breaks the aesthetic simplicity of the concept.

Features one would like to have in a prototype inheritance system include:

These features should be achieved as much as possible by composing independent abstractions with clean simple semantics, instead of piling features in a huge ball of mud with unfathomable complexity. An architecture that enables all these features is typically called a Meta-Object Protocol, or MOP, as made famous by the book The Art of the Metaobject Protocol (AMOP)—except that book uses classes rather than prototypes, and predates a modern functional, compositional and/or categorical approach that we want to use. Another inspiration should be Ian Piumarta's "Open Reusable Object Models". Then we could look at how things are implemented in Slate.