Advanced Search

Browse by Discipline

Scientific Societies

E-print Alerts

Add E-prints

E-print Network

  Advanced Search  

Combining Structural Subtyping and External Dispatch Donna Malayeri Jonathan Aldrich

Summary: Combining Structural Subtyping and External Dispatch
Donna Malayeri Jonathan Aldrich
Carnegie Mellon University
{donna+, aldrich+}@cs.cmu.edu
Nominal subtyping (or user-defined subtyping) and structural sub-
typing each have their own strengths and weaknesses. Nominal
subtyping allows programmers to explicitly express design intent,
and, when types are associated with run time tags, enables run-
time "type" tests (e.g., downcasts) and external/multimethod dis-
patch. On the other hand, structural subtyping is flexible and com-
positional, allowing unanticipated reuse. To date, nearly all object-
oriented languages fully support only one subtyping paradigm or
the other.
In this paper, we describe a core calculus for a language that
combines the key aspects of nominal and structural subtyping in a
unified framework. Our goal is to combine the flexibility of struc-
tural subtyping while still allowing static typechecking of external
methods. We prove type safety for this language and illustrate its
practical utility through examples that are not easily expressed in


Source: Aldrich, Jonathan - School of Computer Science, Carnegie Mellon University


Collections: Computer Technologies and Information Sciences