[E-Lang] Thanksgiving present for E programmers
Mark S. Miller
markm@caplet.com
Wed, 22 Nov 2000 05:11:03 -0800
At 01:23 AM 11/22/00, Tyler Close wrote:
>... Using the ":type" syntax, an
>E programmer can write static type checks. ...
I agree with your entire point except for the use of the word "static" in
the line quoted above. I strongly suspect we have a terminology-only
disagreement. E's :type syntax, as you clearly fully understand from the
rest of your message, expresses a check that must be performed at runtime.
Of course, just like a compiler can perform "3 + 4" at compile time instead
of runtime, a compiler may also use static type checking techniques to
perform many of E's :type checks at compile time. But in both cases, the
compiler must transparently maintain the illusion that computation
happens only at runtime.
E's :type checking is like static type checking in that it causes early
rejection of conditions that may lead to a protocol mismatch problem. But
it is unlike static type checking with regard to how early that is. By
"static" checking, I've always meant rejection sometime before the program
is allowed to begin execution. By contrast, E's :type checking causes
rejection when a variable would be bound or a value returned.
OTOH, E's :type syntax is also designed so that a programmer (or a
programming shop) can build/buy and use other tools outside the E
implementation itself to truly statically check types or other statically
checkable quality issues, and, if they wish, impose on themselves the
discipline of only allowing themselves to commit to programs that pass their
internal static quality checks. The variety of kinds of static quality
checks a shop might want to impose on itself is so great, and getting global
agreement on which ones are good is so hard, it is important to pull these
out of the language definition or implementation. The older folks among us
may imagine one such tool might be called "ELint".
Cheers,
--MarkM