News for hackers. Stuff that matters.
Re:11 year old unsoundness bugs found in Rust borrow checker by wongarsu on Tuesday October 13, 2026 @08:24AM (#50070561)
There is a formally proven compiler for a large subset of C, so I don't see why formalizing (a large subset of) rust and making a formally proven compiler shouldn't be possible
Re:11 year old unsoundness bugs found in Rust borrow checker by afdbcreid on Tuesday October 13, 2026 @08:53AM (#50070909)
There is a severe misunderstanding here. Beside being only a subset, CompCert definitely has UB. It just formalizes codegen for codebases not containing UB, which obviously won't be enough for Rust.
Re:11 year old unsoundness bugs found in Rust borrow checker by afdbcreid on Tuesday October 13, 2026 @08:56AM (#50070951)
Also unlike C, it should be possible to formalize all of Rust, not just a subset. For two reasons: Rust evolution (not initially but today) is strongly tied with formalizing it and the language team consults with formalization experts (which are part of the Rust project themselves) all the time (and formalization or semi-formalization projects are ongoing), and also the mathematical understanding of system languages itself has advanced.
Re:11 year old unsoundness bugs found in Rust borrow checker by j16sdiz on Tuesday October 13, 2026 @09:46AM (#50071693)
This reminds me of Hilbert’s Program .
Re:11 year old unsoundness bugs found in Rust borrow checker by kimi on Saturday October 17, 2026 @05:00AM (#50129231)
You got my reference. But the original comment stands at -1 points now, even mock criticism of C and Rust seems to be totally unappreciated by the bigots.
Re:11 year old unsoundness bugs found in Rust borrow checker by uecker on Wednesday October 14, 2026 @02:08PM (#50092208)
It is possible to formalize all of C.
Re:11 year old unsoundness bugs found in Rust borrow checker by afdbcreid on Sunday October 18, 2026 @01:37PM (#50143319)
Perhaps. We don't know for sure. We also don't know for sure about Rust, but the odds here are greater.
Re:11 year old unsoundness bugs found in Rust borrow checker by UncleMeat on Tuesday October 13, 2026 @08:30AM (#50070627)
Because people want a performant optimizing compiler.
Re:11 year old unsoundness bugs found in Rust borrow checker by MaxBarraclough on Tuesday October 13, 2026 @02:40PM (#50076543)
CompCert produces surprisingly fast native code.

This 2022 article [0] says it generates binaries that run about 7% slower than what GCC produces with -O1.

[0] https://www.cs.cornell.edu/courses/cs6120/2022sp/blog/compce...

Re:11 year old unsoundness bugs found in Rust borrow checker by UncleMeat on Wednesday October 14, 2026 @08:30AM (#50086672)
That's a big gap, especially with the norm for releases being O2 if I understand correctly.
Re:11 year old unsoundness bugs found in Rust borrow checker by MaxBarraclough on Wednesday October 14, 2026 @03:20PM (#50093457)
> That's a big gap

I wouldn't say so. The gap between GCC and Clang/LLVM is bigger than that on some benchmarks, [0] although the gap between their overall performance (using geometric mean) is much less. [1]

It's a very impressive result considering how much effort has gone into GCC. It highlights how compiler optimisation work can face diminishing returns.

> the norm for releases being O2 if I understand correctly

Agreed, but the difference isn't that great. From the article:

> CompCert code is 7% slower than gcc-01 and 12% slower than gcc-02 on average.

Reminds me of how the cproc/qbe C compiler gets very roughly 50% of the performance of Clang/LLVM in 0.1% the lines-of-code. [2]

[0] https://www.phoronix.com/review/gcc-16-vs-clang-22/3

[1] https://www.phoronix.com/review/gcc-16-vs-clang-22/6

[2] https://drewdevault.com/talks/qbe/ (and see the linked slideshow PDF, as the abstract is a little misleading)

Re:11 year old unsoundness bugs found in Rust borrow checker by UncleMeat on Thursday October 15, 2026 @07:21AM (#50102110)
Maybe we just have different experiences, but I've experienced a huge amount of friction trying to enable features that cost something resembling 0.5% of fleet performance, even when they provide massive benefits. 12% loss would be laughed out of the room.

I agree that this is an impressive feat. I also don't see why an equivalent for rust would be adopted.

Re:11 year old unsoundness bugs found in Rust borrow checker by MaxBarraclough on Thursday October 15, 2026 @03:26PM (#50108940)
> I've experienced a huge amount of friction trying to enable features that cost something resembling 0.5% of fleet performance, even when they provide massive benefits. 12% loss would be laughed out of the room.

A 12% difference in performance between two compilers, for some given application, is possible even between two of the best optimising compilers available. A 12% performance lag does not necessarily relegate a compiler to obscurity.

The long-entrenched MSVC compiler is still a major player despite that, for at least some applications and for at least some compiler versions, Clang outperforms it by far more than 12%. [0][1]

If a new Rust compiler really could offer significantly fewer compiler bugs, that would of course need to be weighed against any performance penalty, and the proper tradeoff would of course depend on the project.

> I agree that this is an impressive feat. I also don't see why an equivalent for rust would be adopted.

I imagine it wouldn't be widely adopted for most applications. CompCert itself is pretty niche. It's not Free and Open Source software, which I suspect is a factor, alongside its technical drawbacks.

Unless you're working on ultra-low-defect software, such as in a safety-critical domain, compiler bugs are unlikely to be a major factor in your software's quality. If the compiler lacks support for interesting language features, it becomes an even harder sell for 'ordinary' projects that are able to tolerate an ordinary number of compiler bugs.

[0] https://lemire.me/blog/2023/02/27/visual-studio-versus-clang...

[1] https://discuss.python.org/t/using-clang-cl-for-better-perfo...