News for hackers. Stuff that matters.
Re:Flattening ASTs (and Other Compiler Data Structures) by tayistay on Sunday July 02, 2023 @12:54PM (#36563249)
I'm using this technique in a compiler [1]. One thing I really like about it is that, unlike pointers, I can reuse the integer indices (`ExprRef` in the article) between arrays. So, for example, I have separate arrays for the AST and computed types, which allows the AST to be immutable. (perhaps the article already mentions this advantage, but I didn't see it in the list of advantages)

[1] https://github.com/audulus/lyte

There are no comments on this comment yet.