How Good Is Local Type Inference

A partial type inference technique should come with a simple and precise specification, so that users predict its behavior and understand the error messages it produces. Local type inference techniques attain this simplicity by inferring missing type information only from the types of adjacent syntax nodes, without using global mechanisms such as unification variables. The paper reports on our experience with programming in a full-featured programming language including higher-order polymorphism, subtyping, parametric datatypes, and local type inference. On the positive side, our experiments on several nontrivial examples confirm previous hopes for the practicality of the type inference method. On the negative side, some proposed extensions mitigating known expressiveness problems turn out to be unsatisfactory on close examination. Comments University of Pennsylvania Department of Computer and Information Science Technical Report No.MSCIS-99-17. This technical report is available at ScholarlyCommons: http://repository.upenn.edu/cis_reports/180 How Good is Local Type Inference? Haruo Hosoya Benjamin C. Pierce Department of CIS Department of CIS University of Pennsylvania University of Pennsylvania hahosoya@linc.cis .upenn.edu bcpierce@cis.upenn.edu University of Pennsylvania Technical Report MS-CIS-99-17

[1]  H. Boehm Partial polymorphic type inference is undecidable , 1985, 26th Annual Symposium on Foundations of Computer Science (sfcs 1985).

[2]  Hans-Juergen Boehm Partial Polymorphic Type Inference Is Undecidable , 1985, FOCS.

[3]  Frank Pfenning,et al.  Partial polymorphic type inference and higher-order unification , 1988, LISP and Functional Programming.

[4]  Hans-Juergen Boehm Type inference in the presence of type abstraction , 1989, PLDI '89.

[5]  Graham Hutton,et al.  Higher-order functions for parsing , 1992, Journal of Functional Programming.

[6]  Luca Cardelli An implementation of F , 1993 .

[7]  J. B. Wells Typability and type checking in the second-order Λ-calculus are equivalent and undecidable (Preliminary Draft) , 1993 .

[8]  Alexander Aiken,et al.  Type inclusion constraints and type inference , 1993, FPCA '93.

[9]  Frank Pfenning,et al.  On the Undecidability of Partial Polymorphic Type Reconstruction , 1993, Fundam. Informaticae.

[10]  J. B. Wells,et al.  Typability and type checking in the second-order /spl lambda/-calculus are equivalent and undecidable , 1994, Proceedings Ninth Annual IEEE Symposium on Logic in Computer Science.

[11]  Suresh Jagannathan,et al.  Effective Flow Analysis for Avoiding Run-Time Checks , 1995, SAS.

[12]  Jeroen D. Fokker,et al.  Functional Parsers , 1995, Advanced Functional Programming.

[13]  Scott F. Smith,et al.  Type inference for recursively constrained types and its application to OOP , 1995, MFPS.

[14]  Scott F. Smith,et al.  Subtyping Constrained Types , 1996, SAS.

[15]  François Pottier,et al.  Simplifying subtyping constraints , 1996, ICFP '96.

[16]  B. Pierce,et al.  Local Type Argument Synthesis with Bounded Quantification , 1997 .

[17]  Matthias Felleisen,et al.  Componential set-based analysis , 1997, TOPL.

[18]  François Pottier,et al.  A framework for type inference with subtyping , 1998, ICFP '98.

[19]  Johan Nordlander,et al.  Pragmatic subtyping in polymorphic languages , 1998, ICFP '98.

[20]  Martin Odersky,et al.  Making the future safe for the past: adding genericity to the Java programming language , 1998, OOPSLA '98.

[21]  Dilip Sequeira Type inference with bounded quantification , 1998 .

[22]  Benjamin C. Pierce,et al.  Local type inference , 1998, POPL '98.

[23]  Martin Odersky,et al.  Type Inference with Constrained Types , 1999, Theory Pract. Object Syst..