Adrian Sampson personal blog

Flattening ASTs and other compiler data structures

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.
Points
285
HN comments
130
Submissions
2
Cited by
4 commenters

Software EngineeringSystems & Performance2023

On Hacker News

SubmittedTitle on HNPointsComments
Jul 2, 2023Flattening ASTs and other compiler data structures by fagnerbrack28581
Jan 10, 2025Flattening ASTs and other compiler data structures (2023) by aw162110715749

Cited in comments

Linked from 4 Hacker News comments by 4 different people, from Aug 2023 to Oct 2025.

Most recent:

Search every comment that links here →

More from Adrian Sampson

All 6 posts →

Related posts from the same era