3 ms·
I see lots of comments about how the multiple passes have to do with limited resources like memory. In MLton’s case, (it’s a whole program optimizing compiler)
by strangemonad 9y ago
I see lots of comments about how the multiple passes have to do with limited resources like memory. In MLton’s case, (it’s a whole program optimizing compiler) each trasnlation phase has nothing to do with resource contention. And in general, limited resources is typically handled by separate compilation, not compiler passes.
The more important design choices here have to do with
1) Typed assembly languages (rather than untyped assymbly languages)
2) Type directed translation (rather than syntax directed translation)
3) The ability to reason about the correctness of each step of the translation as the program is gradually lowered from SML to assembly.
For more on the typed assembly language work, check out the work of Morissett and Harper that came out of CMU (specifically the TIL / TAL parts of the ConCert project). The XML type system was developed a little bit before that by Harper and Lillibridge. The general idea of a language being a mathematical object with an elaboration and a semantics where you can reason about progress and preservation at each step is a result of the vision of Robin Milner (there’s a good overview here http://homepages.inf.ed.ac.uk/stg/Milner2012/R_Harper-html4-mp4-large.html http://homepages.inf.ed.ac.uk/stg/Milner2012/R_Harper-html4-...)