I have an advanced draft of a report on the theory of type-checking in POP-11.
There are a few remaining bugs to iron out, but it should appear as a Glasgow
DCS report.
It is clear that parametric polymorphism can only be made to work rigorously
and easily with a purely constructive version of the language. Once one
introduces updating then one has the same kind of problems that occur in ML.
However one can envisage using a type-checker in a looser way as a kind of
critic of programs. And indeed, I think that a graded approach to program
security is the right one. Some applications will demand the best security
that theory can offer. Others will benefit from a coherent critic.
I believe that the kind of type-theory one is forced into for POP-11 is an
interesting one from a more general CS point of view. Because I have to regard
POP-11 functions as acting as parsers/generators operating on the stack, I
regard types generally as -languages- in the sense explained by
Hopcroft&Ullman. But perhaps this is the right view of data-types, which are
often, in a broad sense, sets of sequences either in-store or through-channel.
My theory has an -associative- type-product operator, "*", reflecting this
view, whereas SML has a non-associative operator.
Doing the theory has reminded me again of the importance of -lexicals-. I
really don't think anybody will take POP-11 seriously as a language for today
if the convention of arguments-as-dynamic-locals-by-default remains. From the
point-of-view of the type-theory, dynamic locals appear as a failure of
functional abstraction. In the theory, function-types are defined
behaviourally in terms of what the corresponding code-blocks -do-. What a
given code-block does, at the type level of abstraction, must be constant with
respect to legal transitions of the Virtual Machine. Within this framework,
dlocal variables have to be treated as globals, and not as true local
variables.
Robin Popplestone.
|