Practical type inference based on success typings

57Citations
Citations of this article
72Readers
Mendeley users who have this article in their library.
Get full text

Abstract

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. Copyright © 2006 ACM.

Cite

CITATION STYLE

APA

Lindahl, T., & Sagonas, K. (2006). Practical type inference based on success typings. In PPDP’06 - Proceedings of the Eight ACM SIGPLAN Symposium on Principles and Practice of Declarative Programming (Vol. 2006, pp. 167–178). Association for Computing Machinery (ACM). https://doi.org/10.1145/1140335.1140356

Register to see more suggestions

Mendeley helps you to discover research relevant for your work.

Already have an account?

Save time finding and organizing research with Mendeley

Sign up for free