Flattening ASTs (and Other Compiler Data Structures)

Open link in next tab

Flattening ASTs (and Other Compiler Data Structures)

https://www.cs.cornell.edu/~asampson/blog/flattening.html

This is an introduction to data structure flattening, a special case of arena allocation that is a good fit for programming language implementations. We build a simple interpreter twice, the normal way and the flat way, and show that some fairly mechanical code changes can give you a 2.4× speedup.

Flattening ASTs (and Other Compiler Data Structures)