type system in erlang?

Kostis Sagonas kostis@REDACTED
Fri Dec 16 00:57:24 CET 2005

Waldemar Rachwal wrote:
 > Type system, loose set of modest wishes:
 > 1) Usefull, not academic
 > It has to catch type errors as much as possible, thus relieving a
 > developer of tedious unit tests of thing which should do a compiler.
 > The type system hasn't to claim a right to be "complete" strict system
 > (like in Haskell or OCaml) to be usefull, I think. On the other hand
 > maybe the complete type system make a compiler's analysis easier, I
 > guess.
 > 2) Minimalistic, or incremental
 > I'd want to define types mainly for exported functions, and not for all,
 > at least not at once.
 > 3) Some notion to encompass heterogenous lists. [any()] ?
 > any() would mean potentially different type, from element to element,
 > and [any()] is different than [A], which means any type A, but all list
 > elements of the same type.
 > Some form of relaxation for type system, but expressable.
 > 4) Record types and recursive data types.
 > 5) Intuitive, reflecting how thing are used in practice
 > ... [SNIP] ...
 > I wonder how much these wishes are contradictory in terms of
 > feasibility... ;)

Well, not much.  In fact, we (the HiPE team) already have most of that. (*)

The only things from your wishlist we do not have is "typed" records
(but I've made a proposal to the OTP team and we are still in an
undecided = "let's sleep on it" phase) and the ability to define
recursive data types other than lists.


(*) We actually have more: we have a type inferencer for these things,
    not just a type checker.  I.e., absolutely no declarations needed.

    But, quite sadly, these days we also have funding problems for our
    research. How much is your company willing to pay for these things?

More information about the erlang-questions mailing list