4 ms·
An Update on Gccrs Development
- deleted 2y ago[deleted]
- duped 2y agoTo the "but why" comments, there are some legitimate questions about backends for LLVM - what targets does gcc support that it is easier to write a frontend for a complex language like Rust than add a backend for the desired targets? I can think of some plausible reasons, like: - The backends were contributed by people that have no interest in writing another backend in a different compiler framework or are retired/dead/not paid to do it anymore and no one knows the intracies anymore - Implementing a backend for LLVM is actually harder than writing a new frontend for GCC due to the instability of LLVM IR But I'm interested what others think. It seems like the industry could burn the candle from both ends, as it were.
- kelsey98765431 2y agoMy money is on that last one. Don't GCC frontends usually come before a new LLVM backend?
- ronsor 2y agoIn my personal experience, writing a compiler backend is hard regardless of whether you pick GCC or LLVM.
- SkiFire13 2y agoYou're assuming a new backend would have to be written for LLVM, but you can also write a codegen backend for rustc which uses GCC, this way you get almost the same benefits but without rewriting the whole frontend
- omoikane 2y ago> the trademark rules around the language prevent it from being called a Rust compiler Maybe they can call it a Crab compiler, see also: https://news.ycombinator.com/item?id=36122270 https://news.ycombinator.com/item?id=36122270 - Rust has been forked to the Crab Language (2023-05-30)
- cozzyd 2y agoPatina?
- adastra22 2y agoI think the “but why?” comments are on point. The reason for standardization in C/C++ (proprietary compilers) does not exist for rust. If you’re worried about breakage across compiler releases, then peg the compiler version. Modern tooling doesn’t gets the problems C/C++ standards and multiple implementations solve. I see not just zero but actual negative utility to a second rustic implementation.
- baq 2y agoIf the only win was being able to build a recent rustc on a new architecture without having to build 50 versions it’s still positive.
- adastra22 2y agoThis isn’t the best way towards doing that though. Either use a rust -> C transpiler, or a llvm -> C compiler. Both of those projects already exist btw.
- MBCook 2y agoMost kernels are compiled with GCC right? Being able to use LLVM is a recent in the grand scheme of things. I suspect being able to use GCC might help rust adoption in the kernel because it means people don’t have to use a second to compiler.
- adastra22 2y agoI would have no problem if it was a compiler for a kernel-specific variant or subset of the rust language, and only used for that project. That actually sounds like a good way of moving forward. But they’re talking about making a second implantation for the purpose of quirks documentation and standardization. Rust doesn’t need that.
- SkiFire13 2y agoThat doesn't require a whole new frontend, just a GCC backend will be enough. This is in fact already being worked on with rustc_codegen_gcc https://github.com/rust-lang/rustc_codegen_gcc https://github.com/rust-lang/rustc_codegen_gcc