3 ms·
I heard that GCC supports more architectures than LLVM. Perhaps Rust having a C backend would make sense? On the other hand, I have no idea how tightly coupled
by d33 9y ago
I heard that GCC supports more architectures than LLVM. Perhaps Rust having a C backend would make sense? On the other hand, I have no idea how tightly coupled to LLVM it is.
- adrianN 9y agoLLVM is used for optimizations in Rust. LLVM is more than just a nice way to target multiple backends, it's a very sophisticated set of building blocks for compilers.
- Rusky 9y agoThe language itself isn't coupled to LLVM outside of some underspecified details around things like unsafe and the memory model, which will eventually be better-defined. The compiler has historically been fairly strongly tied to LLVM. This is changing for several reasons as the compiler is refactored, which should enable alternative backends like directly generating C or even plugging directly into GCC. There is also an LLVM backend for generating C, at various levels of maintenance, that might be made to work.
- pjmlp 9y agoA very long term project could be to eventually make the Rust compiler full Rust based. However that would not make much sense from engineering point of view, too many years of optimization algorithms, tooling and supported architectures have been spent into gcc and LLVM backends just to thrown them away in name of purity.
- __s 9y agoRust has tried to not couple its design to LLVM For awhile LLVM could target C
- cpeterso 9y agoThere is some discussion of supporting Mozilla's experimental Cretonne compiler (initially designed to be a new Firefox wasm JIT) as an alternative backend for rustc. Cretonne could be handy for developers wanting faster compile times during development with the cost of less code optimization. https://internals.rust-lang.org/t/possible-alternative-compiler-backend-cretonne/ https://internals.rust-lang.org/t/possible-alternative-compi...