Summary: Static Type Inference in a Dynamically Typed Language
IBM Almaden Research Center
650 Harry Rd.
San Jose, CA 95120
Brian R. Murphy
Computer Science Department
Stanford, CA 94305
We present a type inference system for FL based on an operational, rather than a denotational, formulation
of types. The essential elements of the system are a type language based on regular trees and a type inference
logic that implements an abstract interpretation of the operational semantics of FL. We use a nonstandard
approach to type inference because our requirements---using type information in the optimization of functional
programs---differ substantially from those of other type systems.
Compilers derive at least two benefits from static type inference: the ability to detect and report potential runtime
errors at compiletime, and the use of type information in program optimization. Traditionally, type systems have