Re: Why I don't believe in static typing

From: Joachim Durchholz (joachim.durchholz_at_web.de)
Date: 11/23/03


Date: Sun, 23 Nov 2003 05:26:16 +0100

Raffael Cavallaro wrote:
>
> In any event, before you go to town about the details of software I gave
> as a hypothetical example of the kind of software I *don't* write,
> consider this: One time you really *do* want static type checking is in
> such a hard real time system with lives at risk. But, in your opinion at
> least, it would be "insane" to use Haskell or Ocaml. So in these
> situations, statically typed really does mean C-like languages, where
> the programmer has to make explicit type declarations. This makes it
> seem like the protestations of static typing advocates that statically
> typed doesn't mean C and it's bretheren are a little misleading. In the
> situation where you arguably most want static type guarantees, static
> typing does mean C-like explicit type declarations, and not the type
> inference of Haskell or Ocaml.

Static typing would actually speak *for* Haskell or OCaml when critical
data is processed.
However, there are factors that speak *against* it. First of all, the
compilers aren't verified (at least not in the way that an Ada compiler
is). Second, if hard real time were involved, high-level languages are
generally at a disadvantage since it's more difficult to predict
run-time efficiency; even if amortized efficiency is good, that's not of
much help if your HRT requirements say that it must not only be good but
also predictable.
Note that at this level of required reliability, C would be far more
insane than Haskell or OCaml. I'd use a validated Ada compiler. And I
wouldn't moan too much about the language because I won't write more
than an amortized three lines of code per day - the rest is testing an
documentation. At that rate, programmer productivity and code quality
are determined more by factors like compiler validity and the
availability of validated (!) libraries than by language quality.

Regards,
Jo