Optimizing in my toy compiler

Boriel <boriel@gmail.com>
Thu, 7 Feb 2008 12:05:06 -0800 (PST)

          From comp.compilers

Related articles
Optimizing in my toy compiler boriel@gmail.com (Boriel) (2008-02-07)
Optimizing in my toy compiler nmh@t3x.org (Nils M Holm) (2008-02-11)
Re: Optimizing in my toy compiler max@gustavus.edu (Max Hailperin) (2008-02-12)
| List of all articles for this month |

From: Boriel <boriel@gmail.com>
Newsgroups: comp.compilers
Date: Thu, 7 Feb 2008 12:05:06 -0800 (PST)
Organization: Compilers Central
Keywords: optimize, question
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

J. Rodriguez
[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]

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.