| 1 | 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. |
| 2 | |
| 3 | = Lorito's Ops = |
| 4 | |
| 5 | <basic description of how Lorito's ops work> |
| 6 | |
| 7 | <include subset of ops sufficient for the example> |
| 8 | |
| 9 | = How Continuation-Passing Style Works in HLLs = |
| 10 | |
| 11 | <include introductory explanation (no stack, what "return" means in a CPS context, thinking inside-out)> |
| 12 | |
| 13 | <use Perl to show normal and CPS-based fibonacci code> |
| 14 | |
| 15 | <generalize on how to turn anything into CPS> |
| 16 | |
| 17 | <explain how it works for exceptions, functions, coroutines, tail-calls, etc> |
| 18 | |
| 19 | = How to do CPS with only Low-Level Ops = |
| 20 | |
| 21 | |
| 22 | |
| 23 | = Examples = |
| 24 | |
| 25 | |
| 26 | = References/See Also = |
| 27 | |
| 28 | [http://webcache.googleusercontent.com/search?q=cache:OkuN4KWCSEsJ:trevorjim.com/papers/continuation-closure-passing.ps.gz implementing a CPS code generator for ML] |
| 29 | |
| 30 | [http://www.cs.cornell.edu/talc/papers/stal-tic.pdf |
| 31 | |