Can anyone point me to a good definition of the term \"lowering\" in the context of compilers?
From what I can tell, it is the translation of a higher-level operation in
Dr. Dobbs just published an article by Walter Bright (of dlang fame), where he mentions the term:
Lowering
One semantic technique that is obvious in hindsight (but took Andrei Alexandrescu to point out to me) is called "lowering." It consists of, internally, rewriting more complex semantic constructs in terms of simpler ones. For example,
while
loops andforeach
loops can be rewritten in terms offor
loops. Then, the rest of the code only has to deal withfor
loops. This turned out to uncover a couple of latent bugs in how while loops were implemented in D, and so was a nice win. It's also used to rewritescope guard
statements in terms oftry-finally
statements, etc. Every case where this can be found in the semantic processing will be win for the implementation.If it turns out that there are some special-case rules in the language that prevent this "lowering" rewriting, it might be a good idea to go back and revisit the language design.
Any time you can find commonality in the handling of semantic constructs, it's an opportunity to reduce implementation effort and bugs.