We currently describe Binaryen IR as an Abstract Syntax Tree, but this seems not quite accurate, and has gotten less accurate over time. The one thing it gets right is that our IR is a tree (compared to wasm's stack). But ASTs represent the syntax of a programming language, and there is no programming language that our IR is the an abstract representation of. And as wasm became a stack, that's become even more striking.
Is there a good term for a tree representation in a compiler that is meant for optimization, as opposed to one meant to represent a source language? If there's nothing better, perhaps we could rename AST => IR, since while "IR" is pretty general, it's at least accurate.
We currently describe Binaryen IR as an Abstract Syntax Tree, but this seems not quite accurate, and has gotten less accurate over time. The one thing it gets right is that our IR is a tree (compared to wasm's stack). But ASTs represent the syntax of a programming language, and there is no programming language that our IR is the an abstract representation of. And as wasm became a stack, that's become even more striking.
Is there a good term for a tree representation in a compiler that is meant for optimization, as opposed to one meant to represent a source language? If there's nothing better, perhaps we could rename AST => IR, since while "IR" is pretty general, it's at least accurate.