Re:Want to Write a Compiler? Just Read These Two Papers
by gruseom on Monday June 30, 2008 @08:30PM
(#232586)
Presumably you have the entire program represented as a top-level tree, and a global optimization would be a transformation of that. I don't see why macros wouldn't be just as applicable here as in the local case where you're transforming a subtree.
[ Parent
| on HN ]
Re:Want to Write a Compiler? Just Read These Two Papers
by rahulgarg on Monday June 30, 2008 @09:41PM
(#232619)
I guess u are right. Macros people usually write are local but macros are just AST transformers after all.
I was confusing between what happens during macro expansion (arbitrary computation including lets say doing any analysis and building metadata) versus the result of the macro expansion (a transformed AST).