typing again (was: FAQ terminology harmonisation)
Thu Apr 3 20:44:41 CEST 2003
> > Could someone explain why static typing is considered so "bad"
> > or "unnecessary"? I think I could be sold on this (I _do_
> > consider myself to be open-minded), I just need to hear the
> > right argument.
static typing isn't at all bad, IMHO (I started functional
programming in a dynamically and implicitly typed language, similar
to Erlang in that respect, then moved to Haskell, a statically typed
language where types are mostly implicit thanks to type inference;
the problems involved in that process were not nearly as hard as
expected and, while limitations remain, I do not encounter them as
often as I feared; although I no longer enjoy those cases where I
have to work at the bleeding edge of type system innovation..).
And modern type systems do bring a whole lot of good things.
I think Ulf brought the problem to a point in a recent c.l.f
discussion: as long as you have to choose between advanced type
systems and all the goodies Erlang provides, your choice will
depend on your applications. And for typical Erlang applications,
Erlang goodies are so indispensible that the choice is easy.
Unfortunately, his correspondents didn't quite get it, but next
time some self-appointed evangelist asks how you can do any
safety-critical applications without static typing, the proper
answer is "I'd love to have a better type system, but how can you
do any safety-critical applications without cheap concurrency,
distribution, fault-tolerance, ..."!-)
Of course, be prepared to be surprised - some day, Haskell or
something like it will catch up, we all hope (for myself,
distribution is the main missing bit in Concurrent Haskell, because
adding that would need quite a few non-trivial additions - such as
Dynamics, and possibly some design changes as well).
In this sense, I'd like to throw a couple of references into the
discussion (would be interested to hear opinions..):
a) Clean - similar to Haskell, yet always different:
is currently being extended with support for Dynamics (a way to
get the best of both dynamic and static typing, with a clean
interface between the two worlds), one motivation being typed
communication (between processes, or with the file system).
There are several papers on this, not to mention the theory behind
it, but perhaps most interesting to this list would be a little
concurrency experiment built on top of Dynamics:
Arjen van Weelden and Rinus Plasmeijer. Towards a Strongly Typed
Functional Operating System. To appear in Selected Papers
Proceedings 14th International Workshop on the Implementation of
Functional Languages, IFL 2002, Madrid, Spain, September 16-18,
b) something I haven't read yet (still on my stack), but which seems
directly relevant to the discussion:
S. J. Gay, V. Vasconcelos and A. Ravara. Session Types for
Inter-Process Communication. Technical report TR-2003-133,
Department of Computing Science, University of Glasgow, March 2003.
[idea: just as you can type functions to describe their
call-return interface, say + :: Int -> Int -> Int, you can
try to type processes to describe their communication interface,
say plusServer :: ?Int?Int!Int.End for a server that receives
two numbers, then returns their sum and terminates]
More information about the erlang-questions