This page will describe how the minimal set of ops provided by Lorito can be used to build up complex control flow via continuation-passing style (CPS). An understanding of basic CS concepts and Perl is assumed.

Lorito's Ops

<basic description of how Lorito's ops work>

<include subset of ops sufficient for the example>

How Continuation-Passing Style Works in HLLs

<include introductory explanation (no stack, what "return" means in a CPS context, thinking inside-out)>

<use Perl to show normal and CPS-based fibonacci code>

<generalize on how to turn anything into CPS>

<explain how it works for exceptions, functions, coroutines, tail-calls, etc>

How to do CPS with only Low-Level Ops


References/See Also

 implementing a CPS code generator for ML