4 ms·
A third implementation of the rust compiler. The official compiler has an LLVM backend. GNU also wants to provide rust, and is adding a rust front to their gc
by hyperman1 5y ago
A third implementation of the rust compiler.
The official compiler has an LLVM backend. GNU also wants to provide rust, and is adding a rust front to their gcc compiler.
These monthly reports document the progress until the gcc compiler reaches feature parity with the LLVM-based compiler
- up6w6 5y agoI always thought Rust and other PLs generate LLVM IR and leave the optimizations to LLVM while GCC has something more complex to deal with, doesnt it make things much complicated ?
- steveklabnik 5y agoThis has largely been true for Rust, however, there are some optimizations that the compiler does before generating LLVM IR. * Compiler docs: https://rustc-dev-guide.rust-lang.org/mir/optimizations.html https://rustc-dev-guide.rust-lang.org/mir/optimizations.html * Working Group: https://rust-lang.github.io/compiler-team/working-groups/mir-opt/ https://rust-lang.github.io/compiler-team/working-groups/mir... * Example of one such optimization, "constant propagation" https://blog.rust-lang.org/inside-rust/2019/12/02/const-prop-on-by-default.html https://blog.rust-lang.org/inside-rust/2019/12/02/const-prop...
- gostsamo 5y agoIt is complicated, but GCC has more target platforms.
- mhh__ 5y agoAnd generates faster code depending on which benchmarks matter to you
- astrange 5y agoGCC and LLVM have very similar structures, as do all compilers. LLVM IR is only special because it has a defined serialization. GCC has an IR called GIMPLE that’s fine.
- sampo 5y ago> A third implementation of the rust compiler. What is the second rust compiler?
- steveklabnik 5y agoI am assuming they're talking about https://github.com/thepowersgang/mrustc https://github.com/thepowersgang/mrustc
- shipp02 5y agomrustc[0] I think. [0](https://github.com/thepowersgang/mrustc/ https://github.com/thepowersgang/mrustc/)
- deleted 5y ago[deleted]
- deleted 5y ago[deleted]
- modshatereality 5y agoOthers claim mrustc is the second, but has anyone actually tried to use it? the readme does not inspire too much confidence, and looks to (currently) be a C transpiler: "mrustc's primary goal is bootstrapping rustc, and as such it tends to assume that the code it's compiling is valid (and any errors in the generated code are mrustc bugs). Code generation is done by emitting a high-level assembly (currently very ugly C, but LLVM/cretone/GIMPLE/... could work) and getting an external tool (i.e. gcc) to do the heavy-lifting of optimising and machine code generation." At least it can be used to bootstrap the actual rust compiler. It's a bit crazy to me how popular this language appears to be, but doesn't have a proper second compiler yet.