How to implement continuations?

后端 未结 12 1582
清酒与你
清酒与你 2020-12-22 16:33

I\'m working on a Scheme interpreter written in C. Currently it uses the C runtime stack as its own stack, which is presenting a minor problem with implementing continuation

12条回答
  •  滥情空心
    2020-12-22 17:02

    Besides the nice answers you've got so far, I recommend Andrew Appel's Compiling with Continuations. It's very well written and while not dealing directly with C, it is a source of really nice ideas for compiler writers.

    The Chicken Wiki also has pages that you'll find very interesting, such as internal structure and compilation process (where CPS is explained with an actual example of compilation).

提交回复
热议问题