This is a question about writing compilers. I need to design an IR. Mine is for a pure functional + imperative language. What currently seems popular is SSA with block parameters, not phi nodes, which at least handles the imperative side of my language. My special concern is supporting efficient compile time evaluation (as well as partial evaluation). I guess I want the IR to be a compromise between supporting a fast interpreter (for compile time evaluation) vs supporting conventional compiler optimizations. Does anybody have experience with this?
looks like this could be interesting for you, but I'm not on the topic so cant say for sure
https://futureofcoding.slack.com/archives/C0120A3L30R/p1639986127090700
[December 19th, 2021 11:42 PM] rasen.dubi: :tada: I finally finished the IR refactoring after struggling with it for the last three weeks. I have decided to go without CPS as I understood that CPS is better suited for later stages of compilation.
I have also discovered <https://www.youtube.com/watch?v=Ntj8ab-5cvE|Swift Intermediate Language (SIL)>, which inspired my IR design quite a bit. And I found https://github.com/bytecodealliance/wasmtime/tree/main/cranelift|Cranelift, a compiler framework (like LLVM) that focuses on JIT compilation—it might be a good target to support in the future.