Mojo uses the new MLIR backend. This results in faster compilation times, for example. Rust uses LLVM as backend. Is it possible that rust also uses MLIR as backend and thus benefits from a modern backend?
>> Is it possible that rust also uses MLIR as backend and thus benefits from a modern backend?<p>Compiler backends require corresponding compiler frontends to do lexical analysis and parsing of the programming language into the intermediate representation (IR) that the backend accepts. The Rust compiler frontend currently lexes and compiles Rust source code into LLVM IR.<p>It is possible to create a Rust frontend that lexes and compiles into other intermediate representations and there are several related projects:<p>1) gccrs (<a href="https://github.com/Rust-GCC/gccrs">https://github.com/Rust-GCC/gccrs</a>) is creating a GCC frontend for Rust that can be used with the GCC backend.<p>2) Cranelift (<a href="https://cranelift.dev/" rel="nofollow">https://cranelift.dev/</a>) is creating an alternate LLVM IR-based backend for Rust written in Rust since the current LLVM backend is written in C++.<p>3) rustc_codegen_gcc (<a href="https://github.com/rust-lang/rustc_codegen_gcc">https://github.com/rust-lang/rustc_codegen_gcc</a>) is creating a bridge between the Rust compiler LLVM IR frontend and the GCC backend.<p>So, while it is possible to create a Rust frontend to lex and parse Rust source code into MLIR I am not aware that anyone is working on it.
Mojo is faster because it compiles every function body in parallel, basically every function calls LLVM separately. This means you have to do everything else yourself, which is not easy.