Continuation-passing, closure-passing style

  • Authors:
  • A. W. Appel;T. Jim

  • Affiliations:
  • Department of Computer Science, Princeton University, Princeton, NJ;AT&T Bell Laboratories, Murray Hill, NJ

  • Venue:
  • POPL '89 Proceedings of the 16th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
  • Year:
  • 1989

Quantified Score

Hi-index 0.00

Visualization

Abstract

We implemented a continuation-passing style (CPS) code generator for ML. Our CPS language is represented as an ML datatype in which all functions are named and most kinds of ill-formed expressions are impossible. We separate the code generation into phases that rewrite this representation into ever-simpler forms. Closures are represented explicitly as records, so that closure strategies can be communicated from one phase to another. No stack is used. Our benchmark data shows that the new method is an improvement over our previous, abstract-machine based code generator.