ACM SIGPLAN Notices · 2012 · 45 citations · 20 references
ComputingComputer ScienceAlgorithmsProgramming LanguagesSoftware EngineeringData TypesData-flow AnalysisStatic AnalysisType CheckingType SystemsEscape AnalysisGradual EvolutionGradual TypingRuntime Type SystemsStatic Type CheckingType Inference
Gradual typing lets programmers evolve their dynamically typed programs by gradually adding explicit type annotations, which confer benefits like improved performance and fewer run-time failures. However, we argue that such evolution often requires a giant leap, and that type inference can offer a crucial missing step. If omitted type annotations are interpreted as unknown types, rather than the dynamic type, then static types can often be inferred, thereby removing unnecessary assumptions of the dynamic type. The remaining assumptions of the dynamic type may then be removed by either reasoning outside the static type system, or restructuring the code. We present a type inference algorithm that can improve the performance of existing gradually typed programs without introducing any new run-time failures. To account for dynamic typing, types that flow in to an unknown type are treated in a fundamentally different manner than types that flow out. Furthermore, in the interests of backward-compatibility, an escape analysis is conducted to decide which types are safe to infer. We have implemented our algorithm for ActionScript, and evaluated it on the SunSpider and V8 benchmark suites. We demonstrate that our algorithm can improve the performance of unannotated programs as well as recover most of the type annotations in annotated programs.
20
Trace-based just-in-time type specialization for dynamic languages
Andreas Gal, Brendan Eich, Mike Shaver et al. · 2009 · 341 citations
The design and implementation of typed scheme
Sam Tobin-Hochstadt, Matthias Felleisen · 2008 · 313 citations
Robert Cartwright, Mike Fagan · 1991 · 302 citations · Full text
Cormac Flanagan · 2006 · 268 citations · Full text
Soft typing with conditional types
Alex Aiken, Edward L. Wimmers, T. K. Lakshman · 1994 · 214 citations · Full text