Quantified Types in an Imperative Language

Abstract

We describe universal types, existential types, and type constructors in Cyclone, a strongly-typed C-like language. We show how the language naturally supports first-class polymorphism and polymorphic recursion while requiring an acceptable amount of explicit type information. More importantly, we consider the soundness of type variables in the presence of C-style mutation and the address-of operator. For polymorphic references, we describe a solution more natural for the C level than the ML-style "value restriction." For existential types, we discover and subsequently avoid a subtle unsoundness issue resulting from the address-of operator. We develop a formal abstract machine and type-safety proof that captures the essence of type variables at the C level.

dvi   pdf   ps   (This version is prior to copy-editing.)