[erlang-questions] Why is Erlang what it is?

Ulf Wiger ulf@REDACTED
Thu Dec 14 09:26:06 CET 2006


Kirill Zaborski wrote:
>
> But I have one more question: except that this would be much of work to
> "inject" the type system into Erlang, what do you think - are there any
> real obstacles in the nature and the architecture of Erlang/OTP for some
> kind of static typing?
> It seems to me that if it possible we would became a language very
> different from the "original" Erlang.


There are some original design decisions that make retrofitting a
static type system difficult. Two of the big ones are dynamic code
loading and the message passing, but there are most likely lots
of small snags where functions would have been designed with
different semantics (and different type signatures!) if dynamic
typing weren't available. This is of course partly the "much work"
argument again, but the combination of dynamic typing and advanced
pattern matching is a core characteristic of Erlang, which, for one
thing, leads people to happily write code that would require a PhD
on type systems to even compile in e.g. ML or Haskell. Many would
argue that this is not necessarily a good thing - that static typing
enforces a type discipline that is ultimately good for you.
The truth of that possibly varies depending on problem domain.


Anyway, since we have both Concurrent ML and Concurrent Haskell,
I don't see that making Erlang statically typed is a high priority.
Concurrent ML was designed at roughly the same time as Erlang.
While Erlang's main requirement was to support programming of
robust telecoms systems, a main challenge with Concurrent ML was
to add concurrency in a way that didn't break the type system.
This lead to some fundamentally different design decisions, as
I understand it.

BR,
Ulf W




More information about the erlang-questions mailing list