3 ms·
I am very fascinated by this notion of teaching compilers by starting at code generation and working backwards from there. I've read about nanopass compilers b
by Athas 9y ago
I am very fascinated by this notion of teaching compilers by starting at code generation and working backwards from there. I've read about nanopass compilers before, but do they also work well if the compiler is written in a statically typed language? They clearly will for passes that do not change the program representation, but my experience is that it is awkward to define large amount of similar-but-slightly-different representations in a statically typed language.
- wtetzner 9y agoI think you end up needing macros even in statically typed languages to make it convenient. Even the nanopass framework uses macros to define the different representations.