Metaobject protocols: Why we want them and what else they can do

Metaobject protocols: Why we want them and what else they can do

Traditionally, languages have been designed to be viewed as black box abstractions; end programmers have no control overthe semantics or implementation of these abstractions. The CLOS MOP on the other hand, "opens up" the CLOS abstraction, and its implementation to the programmer. The programmer can, for example, adjust aspects of the implementation strategy such as instance representation, or aspects of the language semantics such as multiple inheritance behavior. The design of the CLOS MOP is such that this opening up does not expose the programmer to arbitrary details of the implementation, nor does it tie the implementor's hand unnecessarily -- only the essential structure of the implementation is exposed.

In more recent work, we have pushed the metaobject protocol idea in new directions, and we now believe that idea is not limited to its specific incarnation in CLOS, or to object-oriented languages, or to languages with a large runtime, or even to Lisp-like languages. Instead, we believe that providing an open implementation can be advantageous in a wide range of high-level languages and that metaobject protocol technology is a powerful tool for providing that power to the programmer.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

MOP For FP!

In more recent work, we have pushed the metaobject protocol idea in new directions, and we now believe that idea is not limited to its specific incarnation in CLOS, or to object-oriented languages, or to languages with a large runtime, or even to Lisp-like languages. Instead, we believe that providing an open implementation can be advantageous in a wide range of high-level languages and that metaobject protocol technology is a powerful tool for providing that power to the programmer.

People did believe any of that?

Old paper...

This is a rather old (1993) paper; two of the authors of this paper were co-authors of Art of the Meta-Object Protocol (1991).

There's nothing in the paper that is groundbreaking today, but the paper (as well as the book) contained some revelations back when it was published--especially for industrial programmers of the time. :)

Whether or not people believed at the time that a "meta-object protocol" was a specific thing to CLOS, I dunno. The Lisp world was probably the only place that a "MOP" was referred to at the time, though effective metaprogramming could be achieved in Smalltalk environments as well.

Why not?

Modern Java systems rely heavily on reflection features that are rather MOP-like, albeit somewhat more constrained and less consistently implemented (cf. Greenspun). That provides some support for the quoted paragraph.

The static functional languages might fall outside the mentioned "wide range of high-level languages", but even they are moving more in the direction of explicit support for metaprogramming. It's more disciplined than CLOS/MOP, with more attention paid to things like phase separation. This could be characterized by saying that those languages are working towards a more principled, statically-analyzable incarnation of the some of the core ideas implemented long ago in CLOS. So what's not to believe?