[PRL] the "success" of types

Greg Pettyjohn gregp at ccs.neu.edu
Mon May 22 09:27:45 EDT 2006



On Sat, 20 May 2006, William D Clinger wrote:

> The point of writing down an invariant that isn't checked at
> compile time, and is checked but poorly even at run time, is
> approximately the same as the point of writing down a purpose
> statement that isn't checked at compile time, and is checked
> but poorly even at run time.


Emphasize "approximately". When I write a purpose statement in Scheme:
1. It is preceded by a ';' and thus I know it is a comment and can never
be checked statically nor dynamically. Comments never masquerade as a
feature of the language/type-system and in that regard can't cause
confusion.

2. Comments (purpose statements) are written in a natural language which
will for decades to come be more expressive than a formal type system
(though perhaps less precise and usually un-checkable.)

3. Comments, written in a natural language, may also be understandable to
someone besides the programmer with domain specific knowledge in
type-theory.

Please don't litter the code with riddles. Use the type system for type
checking. Use comments for purpose statements.



More information about the PRL mailing list