3 ms·
The funny thing about compilers is that one architecture has been established as the dominant architecture (the one described here) for probably the past 50 yea
by nv-vn 7y ago
The funny thing about compilers is that one architecture has been established as the dominant architecture (the one described here) for probably the past 50 years. Almost without exception, every compiler is structured just about exactly the same. If you're interested in an alternative architecture, it's worth reading up about Nanopass compilers. While largely the same basic ideas, Nanopass tries to distill each discrete action into its own pass -- think of it like composing a bunch of programs using shell pipes. So rather than just Frontend=>Middle End=>Backend you end up with something like Lex=>Parse=>Remove Lambdas=>Remove Loops=>Remove Conditionals=>SSA=>Allocate Registers=>Eliminate Dead Code=>.....
- all2 7y agoThis? https://nanopass.org/ https://nanopass.org/ It sounds like someone took the Unix philosophy "each program should do one thing well" and applied it to compilers.
- enos_feedler 7y agoWhen I worked on GPU compiler backends the middle and backend passes basically were a collection of more basic passes that did one thing, in sequence. I wouldn't call this an alternative architecture. I think it's just an implementation detail of the dominant architecture.