skip to main content
10.1145/3239332.3242766acmconferencesArticle/Chapter ViewAbstractPublication PagesicfpConference Proceedingsconference-collections
research-article

Typing the wild in Erlang

Published:29 September 2018Publication History

ABSTRACT

Developing a static type system suitable for Erlang has been of ongoing interest for almost two decades now. The challenge with retrofitting a static type system onto a dynamically typed language, such as Erlang, is the loss of flexibility in programming offered by the language. In light of this, many attempts to type Erlang trade sound type checking for the ability to retain flexibility. Hence, simple type errors which would be caught by the type checker of a statically typed language are easily missed in these developments. This has us wishing for a way to avoid such errors in Erlang programs.

In this paper, we develop a static type system for Erlang which strives to remain sound without being too restrictive. Our type system is based on Hindley-Milner type inference, however it---unlike contemporary implementations of Hindley-Milner---is flexible enough to allow overloading of data constructors, branches of different types etc. Further, to allow Erlang's dynamic type behaviour, we employ a program specialization technique called partial evaluation. Partial evaluation simplifies programs prior to type checking, and hence enables the type system to type such behaviour under certain restricted circumstances.

References

  1. Ana Bove, Peter Dybjer, and Ulf Norell. 2009. A brief overview of Agda–a functional language with dependent types. In International Conference on Theorem Proving in Higher Order Logics. Springer, 73–78. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Luis Damas and Robin Milner. 1982. Principal type-schemes for functional programs. In Proceedings of the 9th ACM SIGPLAN-SIGACT symposium on Principles of programming languages. ACM, 207–212. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Gilles Dowek. 1993. The undecidability of typability in the lambdapi-calculus. In International Conference on Typed Lambda Calculi and Applications. Springer, 139–145. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Mark P Jones. 1999. Typing haskell in haskell. In Haskell workshop, Vol. 7.Google ScholarGoogle Scholar
  5. Neil D Jones, Carsten K Gomard, and Peter Sestoft. 1993. Partial evaluation and automatic program generation. Peter Sestoft. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Tobias Lindahl and Konstantinos Sagonas. 2005. Typer: a type annotator of erlang code. In Proceedings of the 2005 ACM SIGPLAN workshop on Erlang. ACM, 17–25. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Tobias Lindahl and Konstantinos Sagonas. 2006. Practical type inference based on success typings. In Proceedings of the 8th ACM SIGPLAN international conference on Principles and practice of declarative programming. ACM, 167–178. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Simon Marlow and Philip Wadler. 1997. A practical subtyping system for Erlang. ACM SIGPLAN Notices 32, 8 (1997), 136–149. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Robin Milner. 1978. A theory of type polymorphism in programming. Journal of computer and system sciences 17, 3 (1978), 348–375.Google ScholarGoogle ScholarCross RefCross Ref
  10. Didier Rémy. 2002. Using, understanding, and unraveling the OCaml language from practice to theory and vice versa. In Applied Semantics. Springer, 413–536.Google ScholarGoogle Scholar
  11. Mary Sheeran and Gunnar Stålmarck. 1998. A tutorial on Stålmarck’s proof procedure for propositional logic. In International Conference on Formal Methods in Computer-Aided Design. Springer, 82–99. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Typing the wild in Erlang

        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
          Erlang 2018: Proceedings of the 17th ACM SIGPLAN International Workshop on Erlang
          September 2018
          70 pages
          ISBN:9781450358248
          DOI:10.1145/3239332

          Copyright © 2018 ACM

          Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Published: 29 September 2018

          Permissions

          Request permissions about this article.

          Request Permissions

          Check for updates

          Qualifiers

          • research-article

          Acceptance Rates

          Overall Acceptance Rate51of68submissions,75%

          Upcoming Conference

          ICFP '24

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader