Kathleen Fisher

Foundations for Moby Classes

Moby is a class-based object-oriented language designed to fit within the ML-family of languages. It supports object-oriented programming using a combination of ML-style modules, a minimal class mechanism, and primitive object types. Our design philosophy has been to keep language features independent, but complementary. Moby's support for class-based object-oriented programming is a prime example: classes provide support for object creation and inheritance, but we rely on the module system for information hiding and on object types for subtyping. The resulting design is both simple and expressive.

We give semantics to Moby by formalizing the surface language in an external language (EL) and then translating the external language to an internal language (IL) in the style of Harper and Stone. We designed our EL, called MicroMoby, to study the class construct in Moby. Our IL, called MOC, is a new extensible-object calculus designed to provide semantic foundations to our class construct. MOC includes both a static and dynamic semantics, and we prove a subject reduction theorem for the calculus. We give a translation from MicroMoby programs into MOC terms and prove that this translation preserves types. A consequence of this theorem and type-safety for MOC is that MicroMoby is type-safe. The semantics presented here provides a precise characterization of the interaction between Moby's object and class mechanisms.

This work is joint with John Reppy of Bell Labs.


December 9, 1998
3:30pm
Wean 8220