Computing Reviews

Compiling with continuations, or without? Whatever.
Cong Y., Osvald L., Essertel G., Rompf T. Proceedings of the ACM on Programming Languages3(ICFP):1-28,2019.Type:Article
Date Reviewed: 12/16/20

The front end of a compiler analyzes a computer program’s source code and parses it into an intermediate representation (IR). The back end then takes this IR and translates it into machine code for execution. The techniques used for generating the IR ultimately have a large impact on the efficiency, size, and runtime resource requirements of the resulting code.

Cong et al. review and compare the advantages and disadvantages of direct-style IR, which works well in the front end of a compiler with the continuation passing style (CPS) IR pioneered by Steele [1], in 1978, which works well in the back end of a compiler. Indeed, a debate on the pros and cons of the two approaches has been ongoing for decades.

The authors then describe their novel IR proposal--basically a direct-style IR with integrated control operators that facilitate selective use of continuations. The motivation, key ideas, and advantages of the proposed IR are discussed, and its syntax and semantics are described in detail. Potentially large stack allocations are an issue for CPS IRs, and so stack management within the authors’ IR is explained. A case study is described and the implementation approach is evaluated in two different compilers.

The authors add an interesting and novel third option to the discussion on compiling with or without continuations. Their proposed use of a control operator to optimize direct-style IR with selective continuations will no doubt extend the debate on the use of continuations well into the future.


1)

Steele, Jr., G. L. RABBIT: a compiler for SCHEME. Technical Report. Massachusetts Institute of Technology, Cambridge, MA, 1978.

Reviewer:  David B. Henderson Review #: CR147138 (2102-0034)

Reproduction in whole or in part without permission is prohibited.   Copyright 2024 ComputingReviews.com™
Terms of Use
| Privacy Policy