HackerPapers

arXiv:2302.12783cs.PL

Set-theoretic Types for Erlang

Albert Schimpf, Stefan Wehr, Annette Bieniusa

Abstract

Erlang is a functional programming language with dynamic typing. The language offers great flexibility for destructing values through pattern matching and dynamic type tests. Erlang also comes with a type language supporting parametric polymorphism, equi-recursive types, as well as union and a limited form of intersection types. However, type signatures only serve as documentation, there is no check that a function body conforms to its signature. Set-theoretic types and semantic subtyping fit Erlang's feature set very well. They allow expressing nearly all constructs of its type language and provide means for statically checking type signatures. This article brings set-theoretic types to Erlang and demonstrates how existing Erlang code can be statically typechecked without or with only minor modifications to the code. Further, the article formalizes the main ingredients of the type system in a small core calculus, reports on an implementation of the system, and compares it with other static typecheckers for Erlang.

arXiv comments
14 pages, 9 figures, IFL 2022; latexmk -pdf to build
Journal reference
IFL 2022: Proceedings of the 34th Symposium on Implementation and Application of Functional Languages Article No.: 4, Pages 1 - 1
DOI
doi:10.1145/3587216.3587220
Subjects
cs.PLProgramming Languages

On Hacker News

Linked by 2 identifiable commenters in 2 comments across 2 threads, from Jun 2023 to Nov 2023. Found in 1 HN submission from Feb 2023 to Feb 2023. Open submission discussions.

Comments linking this paper, per year.

Discussed in comments2 threads

    • At a glance the type system is quite barebones and nominative. I'd like to see Gleam add support for structural types and maybe set theoretic [1] [1] https://arxiv.org/abs/2302.12783

      lkjaldfwltjohwView on HNParent context

    • There is interest from the Erlang community. Etylizer is a set-theoretic type checker developed for Erlang. We have different objectives, though, as we try to remain backwards compatible with the existing type specs. https://arxiv.org/pdf/2302.12783.pdf

      anne_bieneView on HNParent context

Submitted to Hacker News

Connected through shared HN threads, not inferred similarity or a recommendation.