Structural and Flow-Sensitive Types for Whiley

Download Now Date Added: Jul 2011
Format: PDF

Modern statically typed languages require variables to be declared with a single static type, and that sub-typing relationships between used-defined types be made explicit. This contrasts with dynamically typed languages, where variables are declared implicitly, can hold values of different types at different points and have no restrictions on flow (leading to ad-hoc and implicit sub-typing). The authors present the flow-sensitive and structural type system used in the Whiley language. This permits variables to be declared implicitly, have multiple types within a function, and be retyped after runtime type tests. Furthermore, sub-typing between user-defined types is implicit, based purely on structure. The result is a statically-typed language which, for the most part, has the look and feel of a dynamic language.