- Rewrite interpreter in CPS form.
- Identify Compile time and Runtime actions(CPAs and RTAs)
- Abstract RTAs into separate 'action procedures'.Use thunks to wrap any weird control structures where necessary
- Abstract Continuation Building procedures (CBPs)
- Convert RTAs and CBPs into records. Now the eval on the parse tree spits out a datastructure.
- Write an evaluator for the resulting data structure making sure to (a) implement register spilling (b) 'flatten' code to generate "assembly like" code.
- TODO : investigate the pros and cons of Bottom Up Rewriting Systems (BURS) vs the scheme above vs generating a (gcc) RTL like intermediate language
- TODO : investigate the effects on stack discipline and garbage collection when the various schemes are adopted . Which is more convenient?
Ravi Mohan's Blog
Saturday, June 17, 2006
[DevNote] Interpreter To Compiler
I generally use a wiki (moinmoin in case anyone is interested) on my laptop to keep notes on various projects I work on. However the wiki has not been transferred from my old laptop to my new one. With all the travellng I am doing, this won't get done till the next month or so. Meanwhile I'll use this blog to record (some of) my dev notes (when i can get net access ...sigh.....). Since Blogger doesn't support tagging or categories, I'll prepend a "[DevNote]" string to the title of the post so readers can ignore the post if they wish. These notes are likely to be cryptic and incoherent and most readers should just skip them. To transform an interpreter to a compiler,