Hacker News new | ask | show | jobs
by zabzonk 1021 days ago
using recursive descent, you don't need to build an ast
2 comments

the call stack during recursive descent is an ephemeral ast, for the recursive descent parsers I've written.
That implies the memory usage is proportional to the depth of the AST, not the total size (which is the point, I think).
Only if the compiler doesn't do anything beyond basic peephole optimizations.