Hacker News new | ask | show | jobs
by Athas 3217 days 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.
1 comments

I 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.