Re:GCC Rust: GCC Front-End for Rust
by strongdenial on Sunday January 10, 2021 @12:56PM
(#25717331)
Not 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.
The 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://bootstrapping.miraheze.org/wiki/Main_Page
Re:GCC Rust: GCC Front-End for Rust
by CameronNemo on Sunday January 10, 2021 @05:46PM
(#25721043)
Who 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.
OpenBSD uses clang/llvm on most arches by now for the system compiler.
Re:GCC Rust: GCC Front-End for Rust
by CameronNemo on Tuesday January 12, 2021 @03:37PM
(#25753214)
Uf. Brain fart. I meant that they avoid GCC because of licensing.
bootstrapping 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.
A 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.
Indeed. Notoriously, a SEGV in gcc during compilation used to usually mean "your hardware is flaky": https://tldp.org/FAQ/sig11/html/index.html
That was before the invention of fuzzing.
There 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)
I guess you could rewrite it in a language with no implementation at all if you are worried about purity.
No 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.
How about memory safety and fearless concurrency?