Typed cross-module compilation

  • Authors:
  • Zhong Shao

  • Affiliations:
  • Dept. of Computer Science, Yale University, New Haven, CT

  • Venue:
  • ICFP '98 Proceedings of the third ACM SIGPLAN international conference on Functional programming
  • Year:
  • 1998

Quantified Score

Hi-index 0.01

Visualization

Abstract

Higher-order modules are very effective in structuring large programs and defining generic, reusable software components. Unfortunately, many compilation techniques for the core languages do not work across the module boundaries. As a result, few optimizing compilers support these module facilities well.This paper exploits the semantic property of ML-style modules to support efficient cross-module compilation. More specifically, we present a type-directed translation of the MacQueen-Tofte higher-order modules into a predicative variant of the polymorphic λ-calculus Fω. Because modules can be compiled in the same way as ordinary polymorphic functions, standard type-based optimizations such as representation analysis immediately carry over to the module languages.We further show that the full-transparency property of the MacQueen-Tofte system yields a near optimal cross-module compilation framework. By propagating various static information through the module boundaries, many static program analyses for the core languages can be extended to work across higher-order modules.