2006 · 87 citations · 9 references
ComputingComputer ScienceCompilersFormal MethodsProgramming LanguagesControl-flow AnalysisData TypesType CheckingType SystemsComponent InterfacesPractical InferenceRuntime Type CheckingStatic Type CheckingType AnalysisType InferenceType ReconstructionType Theory
In languages where the compiler performs no static type checks, many programs never go wrong, but the intended use of functions and component interfaces is often undocumented or appears only in the form of comments which cannot always be trusted. This often makes program maintenance problematic. We show that it is possible to reconstruct a significant portion of the type information which is implicit in a program, automatically annotate function interfaces, and detect definite type clashes without fundamental changes to the philosophy of the language or imposing a type system which unnecessarily rejects perfectly reasonable programs. To do so, we introduce the notion of success typings of functions. Unlike most static type systems, success typings incorporate subtyping and never disallow a use of a function that will not result in a type clash during runtime. Unlike most soft typing systems that have previously been proposed, success typings allow for compositional, bottom-up type inference which appears to scale well in practice. Moreover, by taking control-flow into account and exploiting properties of the language such as its module system, success typings can be refined and become accurate and precise We demonstrate the power and practicality of the approach by applying it to Erlang. We report on our experiences from employing the type inference algorithm, without any guidance, on programs of significant size
9
DrScheme: a programming environment for Scheme
Robert Bruce Findler, John Clements, Cormac Flanagan et al. · Journal of Functional Programming · 2002 · 340 citations
Robert Cartwright, Mike Fagan · 1991 · 302 citations · Full text
Type inclusion constraints and type inference
Alex Aiken, Edward L. Wimmers · 1993 · 260 citations
Soft typing with conditional types
Alex Aiken, Edward L. Wimmers, T. K. Lakshman · 1994 · 214 citations · Full text
Manuel V. Hermenegildo, Germán Puebla, Francisco Bueno et al. · Science of Computer Programming · 2005 · 184 citations · Full text