dcreager.net

Baker1995

Henry G. Baker. 1995. CONS should not CONS its arguments, part II: Cheney on the M.T.A. SIGPLAN Not. 30, 9 (Sept. 1995), 17–20.

Remarkable PDF

Original PDF

DOI

» Theory » Continuation passing style

Abstract

Previous Schemes for implementing full tail-recursion when compiling into C have required some form of "trampoline" to pop the stack. We propose solving the tail-recursion problem in the same manner as Standard ML of New Jersey, by allocating all frames in the (garbage-collected) heap. The Scheme program is translated into continuation-passing style, so the target C functions never return. The C stack pointer then becomes the allocation pointer for a Cheney-style copying garbage collection scheme. Our Scheme can use C function calls, C arguments, C variable-arity functions, and separate compilation without requiring complex block-compilation of entire programs. Our C version of the "Boyer" benchmark is available at ftp://ftp.netcom.com/pub/hb/hbaker/cboyer13.c.

BiBTex

@article{10.1145/214448.214454,
author = {Baker, Henry G.},
title = {CONS should not CONS its arguments, part II: Cheney on the M.T.A.},
year = {1995},
issue_date = {Sept. 1995},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
volume = {30},
number = {9},
issn = {0362-1340},
url = {https://doi.org/10.1145/214448.214454},
doi = {10.1145/214448.214454},
journal = {SIGPLAN Not.},
month = sep,
pages = {17–20},
numpages = {4}
}