4 ms·
> There is absolutely no reason why the GCC front-end needs to be written in Rust. How about memory safety and fearless concurrency?
by varajelle 6y ago
> There is absolutely no reason why the GCC front-end needs to be written in Rust.
How about memory safety and fearless concurrency?
- strongdenial 6y agoNot a requirement for a GCC front-end and certainly not worth sacrificing a potentially faster path to bootstrapping the official compiler implementation. You should be worried about the ease by which various systems can bootstrap and adopt the language, which is a mostly solved problem for C/C++ but not a given for Rust itself. Some maintainers will absolutely refuse bootstrapping off of binary artifacts compiled from other systems, others won't even accept 'compiled to C' artifacts. Keeping a viable C++ implementation as part of GCC would be the smartest decision.
- CameronNemo 6y agoWho are these groups who are demanding such easy bootstrapping? OS or distro developers? Programmers working on embedded and/or safety critical systems? I know OpenBSD avoids rust because of the bootstrapping issue, but they also avoid LLVM because of a licensing issue.
- IcePic 6y agoOpenBSD uses clang/llvm on most arches by now for the system compiler.
- CameronNemo 6y agoUf. Brain fart. I meant that they avoid GCC because of licensing.
- gpderetta 6y agobootstrapping is important, but I believe that GCC already allows non-primary (i.e. optional) languages frontends to be written in other languages. The ADA front end is written in ADA for example.
- pabs3 6y agoThe Bootstrappable builds folks dislike binary artifacts so much they are implementing bootstrapping a full Linux system from only 512 bytes of machine code plus all the source code: https://bootstrappable.org/ https://bootstrappable.org/ https://bootstrapping.miraheze.org/wiki/Main_Page https://bootstrapping.miraheze.org/wiki/Main_Page
- rjsw 6y agoI guess you could rewrite it in a language with no implementation at all if you are worried about purity.
- bonzini 6y agoA compiler front-end is pretty boring software in terms of memory safety. Lots of things that the front-end allocates are simply never freed. Have you ever seen GCC crash with a SIGSEGV? I rarely did even when I used to be a GCC developer.
- pm215 6y agoIndeed. Notoriously, a SEGV in gcc during compilation used to usually mean "your hardware is flaky": https://tldp.org/FAQ/sig11/html/index.html https://tldp.org/FAQ/sig11/html/index.html
- zzz11 6y agoThat was before the invention of fuzzing.
- jjnoakes 6y agoThere are still out-of-bounds concerns and chasing through NULL pointers. (Not arguing against gcc's quality or stability, just listing memory safety concerns that transcend memory deallocation)
- Guvante 6y agoNo one is saying that rustc should be rewritten in C. They are saying that an alternative compiler front-end in an alternative language is sensible.
- varajelle 6y agoNo one is saying that someone said rustc should be rewritten.