4 ms·
I wonder if it'd make more sense for the go compiler developers to use ANF (A-normal form [0]) instead of SSA? ANF is less well-known outside of language resear
by profquail 11y ago
I wonder if it'd make more sense for the go compiler developers to use ANF (A-normal form [0]) instead of SSA? ANF is less well-known outside of language research but seems like it'd be a better fit given the design of golang.
[0]: https://en.wikipedia.org/wiki/A-normal_form https://en.wikipedia.org/wiki/A-normal_form
- tonfa 11y agoDoesn't seem easy to translate to it from an imperative language, the wiki page says it's used in functional compilers. Are there examples of ANF used for imperative languages? SSA is fairly well studied, there are many algorithms to transform an IR into SSA and also lots of algorithms for optimizing programs in SSA form.
- willtim 11y agoThis paper discusses going from SSA to ANF: http://tinyurl.com/j25xy5t http://tinyurl.com/j25xy5t
- profquail 11y agoANF is mostly used in functional compilers, but there are plenty of functional languages which aren't purely functional (e.g., Scheme, SML, OCaml) -- which is why I'm wondering if it could be adapted for a more imperative language like go.
- Joof 11y agoSSA is extremely well studied and algorithms for it are fast.