Contraint-based polymorphism in Cecil: towards a practical and static type system

  • Authors:
  • Vassily Litvinov

  • Affiliations:
  • Department of Computer Science and Engineering, University of Washington, Box 352350, Seattle, Washington

  • Venue:
  • Proceedings of the 13th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications
  • Year:
  • 1998

Quantified Score

Hi-index 0.00

Visualization

Abstract

We present a static type system for object-oriented languages which strives to provide static typechecking without resorting to dynamic "type casts," restricting what code the programmer can write, or being too verbose or difficult to use in practice. The type system supports bounded parametric polymorphism where the bounds on type variables can be expressed using general recursive subtype or signature constraints, with F-bounded polymorphism and covariant type parameters being special cases.We implemented this type system in the Cecil language and used it to successfully typecheck a 100,000-line Cecil program, the Vortex optimizing compiler. Our experience was very good: dynamically-typed code needed very little rewriting. We also observed several common programming situations that presented a challenge for our type system. We discuss these situations and ways to typecheck them statically.