Nanopass Framework: Clean Compiler Creation Language
1–10 of 40 posts
Re: Nanopass Framework: Clean Compiler Creation Language
#2Re: Nanopass Framework: Clean Compiler Creation Language
#3Re: Nanopass Framework: Clean Compiler Creation Language
#4Re: Nanopass Framework: Clean Compiler Creation Language
#5I'm often skeptical of the desire to create a lot of passes. In the early Vale compiler, and in the Mojo compiler, we were paying a lot of interest on tech debt because features were put in the wrong pass. We often incurred more complexity trying to make a concept work across passes than we would have had in fewer, larger passes. I imagine this also has analogies to microservices in some way. Maybe other compiler peo…
I'm creating a language/compiler now, and I'm quite certain that I did not have enough passes initially, but I hope I'm at a good spot now - but time will tell.
Re: Nanopass Framework: Clean Compiler Creation Language
#6The optimal number of passes/IRs depends heavily on what language is being compiled. Some languages naturally warrant this kind of an architecture that would involve a lot of passes.
Compiling Scheme for instance would naturally entail several passes. It could look something like the following:
Lexer -> Parser -> Macro Expander -> Alpha Renaming -> Core AST (Lowering) -> CPS Transform -> Beta / Eta Reduction -> Closure Conversion -> Codegen
Re: Nanopass Framework: Clean Compiler Creation Language
#7I'm often skeptical of the desire to create a lot of passes. In the early Vale compiler, and in the Mojo compiler, we were paying a lot of interest on tech debt because features were put in the wrong pass. We often incurred more complexity trying to make a concept work across passes than we would have had in fewer, larger passes. I imagine this also has analogies to microservices in some way. Maybe other compiler peo…
Re: Nanopass Framework: Clean Compiler Creation Language
#8I'm often skeptical of the desire to create a lot of passes. In the early Vale compiler, and in the Mojo compiler, we were paying a lot of interest on tech debt because features were put in the wrong pass. We often incurred more complexity trying to make a concept work across passes than we would have had in fewer, larger passes. I imagine this also has analogies to microservices in some way. Maybe other compiler peo…
I wonder if there's some implicit wisdom that layering/modularizing incurs some communication cost that can cancel all the benefits.
Bottlenecks are changing and it's pretty interesting.
Re: Nanopass Framework: Clean Compiler Creation Language
#9Re: Nanopass Framework: Clean Compiler Creation Language
#10I'm often skeptical of the desire to create a lot of passes. In the early Vale compiler, and in the Mojo compiler, we were paying a lot of interest on tech debt because features were put in the wrong pass. We often incurred more complexity trying to make a concept work across passes than we would have had in fewer, larger passes. I imagine this also has analogies to microservices in some way. Maybe other compiler peo…
There's also a question of data about the trees (like, a flow graph) being recomputed for each nanopass. Also expensive.