skip to main content
10.1145/1250734.1250783acmconferencesArticle/Chapter ViewAbstractPublication PagespldiConference Proceedingsconference-collections
Article

Searching for type-error messages

Published:10 June 2007Publication History

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.

References

  1. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  2. K. Bernstein and E. Stark. Debugging type errors (full version). Technical report, State University of New York at Stony Brook, 1995.Google ScholarGoogle Scholar
  3. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  4. 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 ScholarGoogle Scholar
  5. V. Choppella and C.T. Haynes. Diagnosis of ill-typed programs. Technical Report 426, Indiana University, December 1994.Google ScholarGoogle Scholar
  6. H. Cleve and A. Zeller. Locating causes of program failures. In 27th International Conference on Software Engineering, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. D. Duggan. Correct type explanation. In ACM SIGPLAN Workshop on ML, 1998.Google ScholarGoogle Scholar
  8. D. Duggan and F. Bent. Explaining type inference. Science of Computer Programming, 27(1):37--83, July 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  10. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  11. B.J. Heeren. Top Quality Type Error Messages. PhD thesis, Universiteit Utrecht, The Netherlands, Sept. 2005.Google ScholarGoogle Scholar
  12. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  13. Y. Jun, G. Michaelson, and P. Trinder. Explaining polymorphic types. The Computer Journal, 45(4):436--452, 2002.Google ScholarGoogle ScholarCross RefCross Ref
  14. S. Krishnamurthi, Y.-D. Erlich, and M. Felleisen. Expressing structural properties as language constructs. In European Symposium on Programming, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  16. B. Lerner, D. Grossman, and C. Chambers. Seminal: Searching for ML type-error messages. In ACM SIGPLAN Workshop on ML, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  18. B.J. McAdam. Repairing Type Errors in Functional Programs. PhD thesis, Laboratory for Foundatations of Computer Science, The University of Edinburgh, 2001.Google ScholarGoogle Scholar
  19. G.D. Reis and B. Stroustrup. Specifying C++ concepts. In 33rd ACM Symposium on Principles of Programming Languages, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. P.J. Stuckey, M. Sulzmann, and J. Wazny. Interactive type debugging in Haskell. In ACM SIGPLAN Workshop on Haskell, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  22. M. Wand. Finding the source of type errors. In 13th ACM Symposium on Principles of Programming Languages, 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  24. L. Zolman. STLFilt: An STL error message decryptor for C++. http://www.bdsoft.com/tools/stlfilt.html, 2005.Google ScholarGoogle Scholar

Index Terms

  1. Searching for type-error messages

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in
      • Published in

        cover image ACM Conferences
        PLDI '07: Proceedings of the 28th ACM SIGPLAN Conference on Programming Language Design and Implementation
        June 2007
        508 pages
        ISBN:9781595936332
        DOI:10.1145/1250734
        • cover image ACM SIGPLAN Notices
          ACM SIGPLAN Notices  Volume 42, Issue 6
          Proceedings of the 2007 PLDI conference
          June 2007
          491 pages
          ISSN:0362-1340
          EISSN:1558-1160
          DOI:10.1145/1273442
          Issue’s Table of Contents

        Copyright © 2007 ACM

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 10 June 2007

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • Article

        Acceptance Rates

        Overall Acceptance Rate406of2,067submissions,20%

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader
      About Cookies On This Site

      We use cookies to ensure that we give you the best experience on our website.

      Learn more

      Got it!