3 ms·
Would something derived from Rust's HIR/MIR make a good target for other compiled languages, maybe with lessoned memory safety for some basic blocks.
by tmzt 9y ago
Would something derived from Rust's HIR/MIR make a good target for other compiled languages, maybe with lessoned memory safety for some basic blocks.
- favorited 9y agoUnlikely, unless you want to bake Rust's lifetime system into your language.
- mhh__ 9y agoNot Rust's (Specifically). LLVM IR is actually quite high level as it is, so you can just use it as is. Compiler IRs are normally not that difficult to implement (Designing them is a whole different thing), so it wouldn't be (If a group of devs decided do it) that difficult to define IRs with lowering between each of them. After transforming into a (Approximately C level) IR (Like Cmm in Haskell), you can emit LLVM IR to handle code generation, Register Allocation, LTO etc.