LOOM: An advanced type system for object-oriented programming
We present the design and rationale of a new statically-typed object-oriented
language, LOOM. LOOM's powerful type system supports both parametric
polymorphism via type parameters and a MyType construct providing a flexible
typing for self. These features provide for a very expressive programming
language which is provably type-safe.
The use of MyType leads to the replacement of subtyping by a more general
relation called matching which, in combination with "exact" types, assists
in solving the problems of typing "binary methods". The provision of modules
in the language provides better control over information hiding and allows the
support of privileged access like that of C++'s friends. LOOM's rich type
system can also be added to other languages in order to enhance their
expressiveness as well. As an example, we have a proposed extension to
Java to add a "ThisType" construct and match-bounded polymorphism.