Polymorphic success types for Erlang

Erlang is a dynamically typed concurrent functional language of increasing interest in industry and academia. Official Erlang distributions come equipped with Dialyzer, a useful static analysis tool able to anticipate runtime errors by inferring so-called success types, which are overapproximations to the real semantics of expressions. However, Dialyzer exhibits two main weaknesses: on the practical side, its ability to deal with functions that are typically polymorphic is rather poor; and on the theoretical side, a fully developed theory for its underlying type system –comparable to, say, Hindley-Milner system– does not seem to exist, something that we consider a regrettable circumstance. This work presents a type derivation system to obtain polymorphic success types for Erlang programs, along with correctness results with respect to a suitable semantics for the language.

[1]  Konstantinos Sagonas,et al.  Detecting Software Defects in Telecom Applications Through Lightweight Static Analysis: A War Story , 2004, APLAS.

[2]  Avik Chaudhuri,et al.  Dynamic inference of static types for ruby , 2011, POPL '11.

[3]  Martín Abadi,et al.  Understanding TypeScript , 2014, ECOOP.

[4]  Juan Rodríguez-Hortalá,et al.  Polymorphic Types in Erlang Function Specifications , 2016, FLOPS.

[5]  Davide Ancona,et al.  RPython: a step towards reconciling dynamically and statically typed OO languages , 2007, DLS '07.

[6]  Jeremy G. Siek Gradual Typing for Functional Languages , 2006 .

[7]  Jim Baker,et al.  Design and evaluation of gradual typing for python , 2015, DLS.

[8]  Gavin M. Bierman,et al.  Safe & Efficient Gradual Typing for TypeScript , 2015, POPL.

[9]  Robin Milner,et al.  Principal type-schemes for functional programs , 1982, POPL '82.

[10]  Jean-Yves Girard,et al.  The System F of Variable Types, Fifteen Years Later , 1986, Theor. Comput. Sci..

[11]  Walid Taha,et al.  Gradual Typing for Objects , 2007, ECOOP.

[12]  Jeffrey S. Foster,et al.  Static type inference for Ruby , 2009, SAC '09.

[13]  Sven-Olof Nyström A soft-typing system for Erlang , 2003, ERLANG '03.

[14]  John C. Reynolds,et al.  Types, Abstraction and Parametric Polymorphism , 1983, IFIP Congress.

[15]  Konstantinos Sagonas,et al.  Practical type inference based on success typings , 2006, PPDP '06.

[16]  Avik Chaudhuri,et al.  The ins and outs of gradual type inference , 2012, POPL '12.

[17]  Robert Cartwright,et al.  Soft typing , 1991, PLDI '91.

[18]  Konstantinos Sagonas Using Static Analysis to Detect Type Errors and Concurrency Defects in Erlang Programs , 2010, FLOPS.

[19]  Konstantinos Sagonas,et al.  TypEr: a type annotator of Erlang code , 2005, ERLANG '05.

[20]  Philip Wadler,et al.  A practical subtyping system for Erlang , 1997, ICFP '97.

[21]  Konstantinos Sagonas,et al.  A language for specifying type contracts in erlang and its interaction with success typings , 2007, ERLANG '07.