[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Erlang type system and static vs. dynamic types

Russ Ross <ll@russross.com> writes:

> I was reading Joe Armstrong's paper "The development of Erlang" from
> ICFP '97 and noticed this interesting point when talking about the
> new type system being applied to the standard libraries:
>   "The type system has uncovered no errors.  The kernel libraries
>    were written by Erlang "experts"--it seems that good programmers
>    don't make type errors.  It will be interesting to see if this
>    remains true when we start type checking code written by less
>    experienced programmers."

The trick is that Erlang programmers use really simple data types. :-)

Actually, we have one amazingly complex data structure in our system:
the configuration database. This is very much like the Win32
Registry. It's a tree describing the complete configuration of a set
of network servers, including all the interesting settings for the
operating system and all of the applications.

It's complex because there are so many invariants to maintain. For
example, that the networking settings support the necessary
communications between hosts, that network interfaces aren't used in
incompatible ways, that webservers wanting to use SSL have
certificates configured, and so on. There are several hundred such
rules, and they're not always local -- many have to enforce
consistency between things "all over the place."

We have to prevent people from breaking these invariants. If they try,
using any of the half-dozen different configuration tools, we have to
give them an intelligible error message saying what they did wrong.

I find this a very interesting problem. We've been working with this
system for about four years, and have done lots of funky modifications
and experiments in that time. Some have turned out better than
others. The interaction between the database itself and the tools that
manipulate it is also a very interesting aspect to explore.

I imagine there must be a lot of similar systems around, and a lot of
research that touches on this sort of thing. I'd love to hear about
nice and practical solutions that people on this list know about. I
don't know if the static type checking community have worked out nice
solutions for this kind of problem, but if so I'm happy to be
converted :-)

Luke (The Off-Topic One - but after typing all that I couldn't bring
      myself to just kill this buffer :-))