|Optimizing in my toy compiler firstname.lastname@example.org (Boriel) (2008-02-07)|
|Optimizing in my toy compiler email@example.com (Nils M Holm) (2008-02-11)|
|Re: Optimizing in my toy compiler firstname.lastname@example.org (Max Hailperin) (2008-02-12)|
|Date:||Thu, 7 Feb 2008 12:05:06 -0800 (PST)|
|Posted-Date:||10 Feb 2008 17:25:59 EST|
Hi (and hope this is the right place to post this).
I've like compilers and studying them. I've recently created my own
compiler toolkit in python. It generates LR(k) backtracking parsers,
cutting the tree-search using 1 Lookahead and viable prefixes (well,
I'm not sure how is this technique called :-P I just went my own way
and it seems to optimize very well) and now I'm interested in creating
intermediate code for a test-language (a pseudo ZX Spectrum BASIC)
compiler created with this tool.
If I'm not wrong, stack-oriented code is easy to generate, but
difficult to optimize whilst three or quad code is much easy to
optimize. Any ideas? Which one should you suggest? I'm with "The
Dragon book", and it have *too* much information. :-P
[Depends what you want to do. RPN is indeed easy to generate and
interpret, but it's a pain to optimize. Triples and quads aren't much
harder to interpret but are easier to optimize because the connection
between sources and uses of data are more explicit. -John]
Return to the
Search the comp.compilers archives again.