AbstractI outline a new IR for the Nim compiler that aims to reduce the compiler’s overall complexity. MotivationNim’s IR is based on its AST: While the AST served us well in the past, it’s now clear that many of Nim’s features like “definite assignment analysis”, “nil checking” or its “move analyser” would be easier with a different program representation. NGIR is that different representation. DescriptionI called it the “Nim goto intermediate representation (NGIR)”. The type system is left untouched and everything is strictly typed. NGIR focuses on a control flow abstraction. Function calls can remain nested. Compared to the AST NGIR contains these major changes:
|
