Hostname: page-component-7c8c6479df-5xszh Total loading time: 0 Render date: 2024-03-28T13:22:14.128Z Has data issue: false hasContentIssue false

Intensional polymorphism in type-erasure semantics

Published online by Cambridge University Press:  06 November 2002

KARL CRARY
Affiliation:
Carnegie Mellon University, School of Computer Science, Carnegie Mellon University, 5000 Forbes Avenue, Pittsburgh, PA 15213, USA
STEPHANIE WEIRICH
Affiliation:
Department of Computer Science, Cornell University, 4130 Upson Hall, Ithaca, NY 14853-7501, USA
GREG MORRISETT
Affiliation:
Department of Computer Science, Cornell University, 4130 Upson Hall, Ithaca, NY 14853-7501, USA
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the ‘Save PDF’ action button.

Intensional polymorphism, the ability to dispatch to different routines based on types at run time, enables a variety of advanced implementation techniques for polymorphic languages, including tag-free garbage collection, unboxed function arguments, polymorphic marshalling and attened data structures. To date, languages that support intensional polymorphism have required a type-passing (as opposed to type-erasure) interpretation where types are constructed and passed to polymorphic functions at run time. Unfortunately, type-passing suffers from a number of drawbacks: it requires duplication of run-time constructs at the term and type levels, it prevents abstraction, and it severely complicates polymorphic closure conversion. We present a type-theoretic framework that supports intensional polymorphism, but avoids many of the disadvantages of type passing. In our approach, run-time type information is represented by ordinary terms. This avoids the duplication problem, allows us to recover abstraction, and avoids complications with closure conversion. In addition, our type system provides another improvement in expressiveness; it allows unknown types to be refined in place, thereby avoiding certain beta-expansions required by other frameworks.

Type
Research Article
Copyright
© 2002 Cambridge University Press
Submit a response

Discussions

No Discussions have been published for this article.