4 ms·
1. GCC supports more target platforms than LLVM, including many low-volume embedded systems that are unlikely to ever get upstream LLVM support. 2. The GCC dev
by jmillikin 3y ago
1. GCC supports more target platforms than LLVM, including many low-volume embedded systems that are unlikely to ever get upstream LLVM support.
2. The GCC developers are interested in supporting a broad set of languages that compile to native executables, and Rust is an increasingly popular language for systems programming.
3. Whether something is "necessary" or not has never been decisive in whether or not it happens. When presented with a programming challenge, why not try it and see what comes out?
- epage 3y agoFor (1) there is a parallel effort to add a gcc backend to the rustc frontend.
- phkahler 3y ago4. Some would like to use th we same compiler for everything. Right now, building the Rust bit of Linux requires LLVM. Why shouldn't you be able to build everything using gcc alone?
- duped 3y agoBecause they're different languages? It's more insane to me that one wants the same tool to do everything rather than have different tools for different tasks. Like should Perl be compiled with GCC just to satisfy that requirement because it's used during the kernel build? That's ridiculous!
- azov 3y agoYeah, you start down this path and one day you end up with compilers for Go, or Ada, or Fortran, or who knows what else. How ridiculous would that be! PS. GCC stands for “GNU Compiler Collection”. All of the above is already there.
- deleted 3y ago[deleted]
- shakow 3y agoGCC already compiles quite a lot of languages, why not add one to the toolbelt if contributors feel like it?
- duped 3y agoEven though I think it'd be a bad idea for users of the language to rely on gcc to compile their Rust code, what I'm replying to is the idea that having one compiler for all the languages used in a project is a good idea in the first place. I don't think you should expect or want that.
- galangalalgol 3y agoI haven't been able to find a coherent comparison of what targets are supported by gcc vs llvm. Wasm ptx, and spirv seem to be llvm only? But the gcc list is kind of confusing. 8051 is mayne gcc only? Or is that even supported by gcc? Other than 8051, all the uc stuff I'm familiar with was in llvm. I'm not sure what 68k support means though, there have been so many variants. More simply, what machines will I be able to compile rust for once this hits that I couldn't before? Gameboy? C64?
- jmillikin 3y agoAncient big iron (SPARC, PA-RISC, Alpha), weird embedded with vendor-provided toolchains based on GCC, and recent architectures that don't have mature LLVM support (Longsoon). m68k is already supported by LLVM and Rust supports it as a tier-3 target platform.
- galangalalgol 3y agoYeah I saw 68k in there, rust also will target sparc and sparc64. And s930, but yeah, I can see how alpha and pa-risc support would be really important for linux to continue supporting. Xtensa got upstream support, but so many embedd vendors seem to want to double dip and sell build tools, so they don't upstream their llvm based build tools. Shortsighted imo. Vendors that don't charge for build tools will make it up in sales volume.
- cozzyd 3y agoVendors not upstreaming their llvm-based build tools is exactly why you should support a GPL compiler like gcc.
- moltonel3x 3y agoGPL doesn't force upstreaming, just making the sources available. Plenty of small vendors are not upstreaming their gcc patches. It's more a question of man-hours than of license.
- 3y ago