Making Type Inference Practical

Forfattere

  • Nicholas Oxhøj
  • Jens Palsberg
  • Michael I. Schwartzbach

DOI:

https://doi.org/10.7146/dpb.v21i385.6618

Resumé

We present the implementation of a type inference algorithm for untyped object-oriented programs with inheritance, assignments, and late binding.The algorithm significantly improves our previous one, presented at OOPSLA'91, since it can handle collection classes, such as {\bf List}, in a useful way. Also, the complexity has been dramatically improved, from exponential time to low polynomial time. The implementation uses the techniques of incremental graph construction and constraint template instantiation to avoid representing intermediate results, doing superfluous work, and recomputing type information. Experiments indicate that the implementation type checks as much as 100 lines pr. second. This results in a mature product, on which a number of tools can be based, for example a safety tool, an image compression tool, a code optimization tool, and an annotation tool. This may make type inference for object-oriented languages practical.

Downloads

Publiceret

1992-02-01

Citation/Eksport

Oxhøj, N., Palsberg, J., & Schwartzbach, M. I. (1992). Making Type Inference Practical. DAIMI Report Series, 21(385). https://doi.org/10.7146/dpb.v21i385.6618