WebAssembly / binaryen

Optimizer and compiler/toolchain library for WebAssembly
Apache License 2.0
7.41k stars 731 forks source link

Terminology bikeshedding: AST => ? #1188

Open kripken opened 6 years ago

kripken commented 6 years ago

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.

dschuff commented 6 years ago

I don't know of any others. I've mostly been using "IR" in my own comments, it's probably good enough.