[comp.object] Typed Smalltalk type system

johnson@m.cs.uiuc.edu (10/29/90)

Craig Chambers made a couple of comments about Typed Smalltalk
to which I would like to respond.  Typed Smalltalk can handle
both of the Smalltalk features that he mentioned, which are 
perform: and OrderedCollection.  The solution for perform: is
fine theoretically, though we have yet to see how well it works
in practice.  The solution for OrderedCollection works well in
practice, though it relies on a hack.

As Craig said, all static type systems are conservative.  Whether
this is a problem or not depends on how conservative they are.
Most of the type system have some loop-hole, such as casts in
C and C++.  Loop-holes do not cause a problem as long as they
are almost never used.  One of the advantages of C++ over C is
that casts are much more infrequent.  We use a loop-hole in the
type system to type-check OrderedCollection in Smalltalk.  To
the best of my knowledge, the only other place in the Smalltalk
image that needs to use the loop-hole is the debugger, but we
haven't type-checked the whole image yet, so we really don't
know for sure.

We are not particularly happy with having to use a loop-hole, and
are working on a couple of extensions to the type system that
would make it unnecessary.  Since type systems are always conservative,
I suppose a loop-hole facility is always necessary, but I will be
unhappy with any particular use of the facility.

Ralph Johnson -- University of Illinois at Urbana-Champaign