Indexed Reverse Polish Notation, an Alternative to AST | Lobsters
lobste.rs·1d·
Discuss: Lobsters
📑Inverted Indexes
Preview
Report Post

Thanks, the talk is really interesting.

Thinking about this more, the representation in the blog post is also too simple and I suspect it will be super wasteful in practice if you apply it directly. It stores all types of nodes in the same vector, so the elements need to be as large as the largest AST node (or you box the nodes which I suspect will be a worse solution than the traditional pointer-based ASTs as you have an extra layer of indirection now when going from a parent to child node). They address this in the talk you linked where they keep some of the information on side tables/other vectors. In byte code you don’t have this issue if you treat the byte code is a binary blob with variable-size instructions. This works because typically you don’t need to go from e.g. an in…

Similar Posts

Loading similar posts...