| John Reppy | Jon Riecke | |
| AT&T Research | Bell Laboratories | |
| jhr@research.att.com | riecke@research.att.com |
This paper proposes a new approach to adding objects to the statically-typed, higher-order language Standard ML. Our approach sacrifices some of the expressiveness found in recently proposed schemes for typing object-oriented features, but by doing so, we avoid a tremendous amount of complexity in the type system. In fact, our system is a conservative extension of the SML type system, and preserves the important properties of SML: sound static typing, and type inference. Our approach is based on introducing object types, which have an explicitly declared subtyping hierarchy, and object constructors. Just as datatype constructors are used to guide type inference of recursive types, we use object type constructors to guide the inference of subtyping. The introduction of object constructors also has the effect of generalizing the SML case statement to be a typecase on object types. Using this mechanism, we can often recover type information that our type system cannot preserve statically. In addition to describing the features of OML, the paper includes examples of how features found in other object-oriented languages can be emulated in OML. It also discusses the formal properties of OML, and some of the implementation issues.
This paper will be presented at PLDI'96
Keywords: Programming language design, object-oriented programming,