A Core Calculus of Metaclasses

A Core Calculus of Metaclasses - written by Sam Tobin-Hochstadt and Eric Allen for Fool 12

Metaclasses provide a useful method of abstraction for programmers working with object-oriented languages, but they have not seen the formal exploration applied to more conventional object-oriented programming features. In order to elucidate the structure of metaclasses and their relationship with static typing, we present a core calculus for a nominally-typed object-oriented language with metaclasses and prove type soundness over this core.

Metaclasses are a nifty (albeit somewhat arcane) OOP feature. I found the article interesting, but I had a lot of trouble with the elaborate type soundness proofs. Those who are unfamiliar with metaclass programming might want to read some introductory material before tackling this article. Metaclass Programming in Python by Mertz and Simionato is a particularly good overview.

Comment viewing options

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

Very interesting!

Thanks for the link. Also, I must admit my newbie status here but how applicable is this theory of metaclasses to Haskell classes?