ABSTRACT
Advanced type systems often need some form of type inference to reduce the burden of explicit typing, but type inference often leads to poor error messages for ill-typed programs. This work pursues a new approach to constructing compilers and presenting type-error messages in which the type-checker itself does not produce the messages. Instead, it is an oracle for a search procedure that finds similar programs that do type-check. Our two-fold goal is to improve error messages while simplifying compiler construction. Our primary implementation and evaluation is for Caml, a language with full type inference. We also present a prototype for C++ template functions, where type instantiation is implicit. A key extension is making our approach robust even when the program has multiple independent type errors.
- M. Beaven and R. Stansifer. Explaining type errors in polymorphic languages. ACM Letters on Programming Languages and Systems, 2(1-4):17--30, 1993. Google Scholar
Digital Library
- K. Bernstein and E. Stark. Debugging type errors (full version). Technical report, State University of New York at Stony Brook, 1995.Google Scholar
- M.G. Burke and G.A. Fisher. A practical method for LR and LL syntactic error diagnosis and recovery. ACM Transactions on Programming Languages and Systems, 9(2):164--197, 1987. Google Scholar
Digital Library
- O. Chitil, F. Huch, and A. Simon. Typeview: a tool for understanding type errors. In MMohnen and PKoopman, editors, 12th International Workshop on Implementation of Functional Languages, Aachner Informatik-Berichte, 2000.Google Scholar
- V. Choppella and C.T. Haynes. Diagnosis of ill-typed programs. Technical Report 426, Indiana University, December 1994.Google Scholar
- H. Cleve and A. Zeller. Locating causes of program failures. In 27th International Conference on Software Engineering, 2005. Google Scholar
Digital Library
- D. Duggan. Correct type explanation. In ACM SIGPLAN Workshop on ML, 1998.Google Scholar
- D. Duggan and F. Bent. Explaining type inference. Science of Computer Programming, 27(1):37--83, July 1996. Google Scholar
Digital Library
- M. Gandhe, G. Venkatesh, and A. Sanyal. Correcting errors in the Curry system. In 16th Conference on Foundations of Software Technology and Theoretical Computer Science, 1996. Google Scholar
Digital Library
- C. Haack and J.B. Wells. Type error slicing in implicitly typed higher-order languages. Science of Computer Programming, 50(1-3):189--224, 2004. Google Scholar
Digital Library
- B.J. Heeren. Top Quality Type Error Messages. PhD thesis, Universiteit Utrecht, The Netherlands, Sept. 2005.Google Scholar
- J. Järvi, D. Gregor, J. Willcock, A. Lumsdaine, and J. Siek. Algorithm specialization in generic programming: challenges of constrained generics in C++. In ACM Conference on Programming Language Design and Implementation, 2006. Google Scholar
Digital Library
- Y. Jun, G. Michaelson, and P. Trinder. Explaining polymorphic types. The Computer Journal, 45(4):436--452, 2002.Google Scholar
Cross Ref
- S. Krishnamurthi, Y.-D. Erlich, and M. Felleisen. Expressing structural properties as language constructs. In European Symposium on Programming, 1999. Google Scholar
Digital Library
- O. Lee and K. Yi. Proofs about a folklore let-polymorphic type inference algorithm. ACM Transactions on Programming Languages and Systems, 20(4):707--723, 1998. Google Scholar
Digital Library
- B. Lerner, D. Grossman, and C. Chambers. Seminal: Searching for ML type-error messages. In ACM SIGPLAN Workshop on ML, 2006. Google Scholar
Digital Library
- B.J. McAdam. On the unification of substitutions in type inference. In K. Hammond, A.J. Davie, and C. Clack, editors, Implementation of Functional Languages, volume 1595 of LNCS, 1998. Google Scholar
Digital Library
- B.J. McAdam. Repairing Type Errors in Functional Programs. PhD thesis, Laboratory for Foundatations of Computer Science, The University of Edinburgh, 2001.Google Scholar
- G.D. Reis and B. Stroustrup. Specifying C++ concepts. In 33rd ACM Symposium on Principles of Programming Languages, 2006. Google Scholar
Digital Library
- P.J. Stuckey, M. Sulzmann, and J. Wazny. Interactive type debugging in Haskell. In ACM SIGPLAN Workshop on Haskell, 2003. Google Scholar
Digital Library
- F. Tip and T.B. Dinesh. A slicing-based approach for locating type errors. ACM Transactions on Software Engineering and Methodology, 10(1):5--55, 2001. Google Scholar
Digital Library
- M. Wand. Finding the source of type errors. In 13th ACM Symposium on Principles of Programming Languages, 1986. Google Scholar
Digital Library
- A. Zeller. Yesterday, my program worked. today, it does not. Why? In 7th European Software Engineering Conference and 7th ACM Symposium on the Foundations of Software Engineering, 1999. Google Scholar
Digital Library
- L. Zolman. STLFilt: An STL error message decryptor for C++. http://www.bdsoft.com/tools/stlfilt.html, 2005.Google Scholar
Index Terms
Searching for type-error messages
Recommendations
Searching for type-error messages
Proceedings of the 2007 PLDI conferenceAdvanced type systems often need some form of type inference to reduce the burden of explicit typing, but type inference often leads to poor error messages for ill-typed programs. This work pursues a new approach to constructing compilers and presenting ...
Seminal: searching for ML type-error messages
ML '06: Proceedings of the 2006 workshop on MLWe present a new way to generate type-error messages in a polymorphic, implicitly, and strongly typed language (specifically Caml). Our method separates error-message generation from type-checking by taking a fundamentally new approach: we present to ...
Type-safe distributed programming for OCaml
ML '06: Proceedings of the 2006 workshop on MLExisting ML-like languages guarantee type-safety, ensuring memory safety and protecting the invariants of abstract types, but only within single executions of single programs. Distributed programming is becoming ever more important, and should benefit ...







Comments