News for hackers. Stuff that matters.
Re:Relive: 50 years of C, the good, the bad and the ugly by tmtvl on Friday December 30, 2022 @11:26AM (#34186521)
As long as there isn't a Rust compiler written in Rust (there is a transpiler to LLVM bytecode, but that gets compiled by a C++ compiler, same for GCC-rs) I don't think a C-free (or a C++-free) build will be possible at all, so I'm guessing it'll take somewhere in the 60-100 year range.
Re:Relive: 50 years of C, the good, the bad and the ugly by ansible on Friday December 30, 2022 @11:46AM (#34186754)
There are some open issues and features like inline assembly that aren't supported, but a moderately complete backend exists now:

https://github.com/bjorn3/rustc_codegen_cranelift

The compiler frontend is already written in Rust.

Re:Relive: 50 years of C, the good, the bad and the ugly by estebank on Friday December 30, 2022 @03:38PM (#34189805)
Honest question: what would the engineering rationale be behind dropping LLVM entirely and have rustc have its own code generation backend? There are two out there that might be interesting, one uses gcc and another is called cranelift, but it isn't the default and focuses exclusively on compilation speed for debug binaries.
Re:Relive: 50 years of C, the good, the bad and the ugly by tmtvl on Friday December 30, 2022 @06:36PM (#34191464)
Well people keep telling me that C/C++ code should be replaced by Rust for ~safety~ reasons, and LLVM is a C++ project, so...

Let's say it would avoid all the memory bugs in LLVM, that would doubtlessly make it worth throwing away the LLVM implementation (avoid sunk cost fallacy).

Re:Relive: 50 years of C, the good, the bad and the ugly by tialaramex on Friday December 30, 2022 @07:14PM (#34191767)
If anything, it's more likely that the desirable choice is to shift LLVM to Rust.