Abstract
Erlang is a strict, dynamically typed functional programming language popular for its use in distributed and fault-tolerant applications. The absence of static type checking allows ill-typed programs to cause type errors at run time. The benefits of catching these type errors at compile time are the primary motivation for introducing a static type system for Erlang. The greatest challenge is to find a balance between keeping the type checking sound while retaining the flexibility and philosophy of the Erlang. However, since Erlang allows higher-rank polymorphism, it is unavoidable to require type annotations for some functions to ensure decidability. In this paper, we propose a static type system for Erlang based on bidirectional type checking. In bidirectional type checking, terms are either used to infer a type, or they are checked against a given type. With the bidirectional type checking, we are trying to keep type checking sound without limiting the language’s philosophy. In addition, type annotations are only required when inference fails, which only occurs at predictable places, such as usage of higher-ranked polymorphism.
Published Version (Free)
Talk to us
Join us for a 30 min session where you can share your feedback and ask us any queries you have