Space Issues in Compiling with Intersection and Union Types
Allyn Dimock, Ian Westmacott, Robert Muller · 2000
The CIL compiler for core Standard ML compiles whole programs using the CIL typed intermediate language with ow labels and intersection and union types. Flow labels embed ow information in the types and intersection and union types support precise polyvariant type and ow information, without the use of type-level abstraction or quantication. Compile-time representations of CIL types and terms are potentially large compared to those for similar types and terms in systems based on quantied types. The listing-based nature of intersection and union types, together with ow label annotations on types, contribute to the size of CIL types. The CIL term representation duplicates portions of the program where intersection types are introduced and union types are eliminated. This duplication makes it easier to represent type information and to introduce multiple representation conventions, but incurs a compile-time space cost. This paper presents empirical data on the compile-time space costs of using CIL. These costs can be made tractable using standard hash-consing techniques. Surprisingly, the duplicating nature of CIL has acceptable compile-time space performance in practice on the benchmarks and ow analyses that we have investigated. Increasing the precision of ow analysis can signicantly reduce compile-time space costs. There is also preliminary evidence that the ow information encoded in CIL's type system can eectively guide data customization. 1