[E-Lang] Thanksgiving present for E programmers
Jonathan S. Shapiro
shap@eros-os.org
Wed, 22 Nov 2000 09:54:52 -0500
Language lawyer warning:
> E's :type syntax, as you clearly fully understand from the
> rest of your message, expresses a check that must be performed at runtime.
I'm sure this is an accurate statement of what is actually required, but it
is a bad statement of specification. A (possibly) better statement of
specification is:
E's :type syntax expresses a predicate that must be true
at runtime for execution to follow the normal flow of
control. If the predicate is false, an exception is thrown (?).
The predicate is normally verified by a runtime check,
but the compiler is free to optimize this check away if
it can determine statically that the check is unnecessary.
I believe this is consistent with the rest of your note, but I think this
verbiage makes a clearer statement of the requirement. If you don't like the
word "predicate" for your readers, substitute "type requirement".
A proper specification, of course, must also specify the interaction between
the predicate check and the inheritance design, if any. Accompanying
explanatory notes should identify any hazards associated with this
interaction -- I'm thinking here about a statement to the effect that
inheritance frequently obscures contravariance bugs, and that depending on
the satisfaction criteria the meaning of the type check differs.
> By "static" checking, I've always meant rejection sometime before the
> program is allowed to begin execution.
Nit: I think you mean "...before the program is considered semantically
meaningful." Or perhaps "...before the program is well-formed."
Jonathan