2 ms·
Do you run an optimization pass on the AST between parsing and evaluation?
by catlifeonmars 6mo ago
Do you run an optimization pass on the AST between parsing and evaluation?
- pizlonator 6mo agoI run a “resolve” pass. That’s where for example getter inference happens.
- HarHarVeryFunny 6mo agoFor an interpreter / AST executor, I think a big win would be efficient parsing in the first place, in particular using a precedence parser for expressions vs recursive descent, which would avoid the need to optimize the AST to remove the 1:1 "unit productions" in the grammar.