CPS-Transformation OLIVIER DANVY and JOHN Kansas State University After Strictness Analysis HATCLIFF Strictness analysis is a common component of compilers for call-by-name functional languages; the continuation-passing-style (CPS-) transformation is a common component of compilers for call-by-value functional languages. To bridge these two implementation techniques, we present a hybrid CPS-transformation &, for a language with annotations resulting from strictness analysis. %8 is derived by symbolically composing two transformations Y and &v; that is def $3, =s .9. Y transforms a call-by-name program with strictness annotations into a call-by-value program extended with explicit suspension constructs (i.e., delay and force). %v is the traditional call-by-value CPS-transformation extended with transformations for the suspension constructs delay and force. %, generalizes both the call-by-name and the call-by-value CPS-transformations, in that restricting it to nonstrict constructs gives the call-by-name CPS-transformation and restricting it to strict constructs gives the call-by-value CPS-transformation. %, enables a new strategy for compiling call-by-name programs combining the traditional advantages of CPS (tail-recursive code, evaluation-order independence) and the usual benefits of strictness analysis (elimination of unnecessary suspensions). We also address and solve the problem of recursive binding. Finally, we express %, in Nielson and Nielson s two-level A-calculus, enabling a simple
/lp/association-for-computing-machinery/cps-transformation-after-strictness-analysis-X6Z8rDmkhY