3 ms·
It's actually LLVM, not Clang (which also uses LLVM). Yes, it would be a tremendous amount of work to write a Rust compiler from scratch, but you can also writ
by eddyb 11y ago
It's actually LLVM, not Clang (which also uses LLVM).
Yes, it would be a tremendous amount of work to write a Rust compiler from scratch, but you can also write a LLVM backend.
Not in a weekend, but it's possible. Bonus points for having both rustc and Clang work with it.
Alternatively, once the MIR (Mid-level rust IR) work is done, you will be able to write your own lowering code from that to, say, PIC assembly.
It won't be optimized and you'll probably output a lot of code (compared to a fully featured GCC backend at -Os), but you would be able to do it in a weekend.