News for hackers. Stuff that matters.
Re:Problems with the Rust Language by pornel on Wednesday October 14, 2026 @07:28PM (#50097047)
It's been over 10 years since Rust 1.0 was released, and C programmers still see it as a new fad. Yet, the same article mentions, but fails to connect the dots, that even the large slow-moving corporations bankrolling the foundation have already adopted Rust and are leaving C as fast as they can.

It's a typical C mindset that rewriting programs creates new bugs, because it takes years to "battle test" and shake bugs out of a C program. In my experience rewrites in Rust uncover latent bugs of C programs when they finally get checked lifetimes, useful type system, enforced error checking, etc.

Re:Problems with the Rust Language by AnimalMuppet on Wednesday October 14, 2026 @07:56PM (#50097333)
That's not how rewrites create new bugs. It's not type or lifetime or error checking bugs, for the most part. It's "sometime in the ten years that this code has existed, someone ran into this weird corner case. This little detail right here fixes it. But the guys doing the rewrite weren't around ten years ago, and they don't know that the corner case even exists, so they don't know which specific details of the existing code they need to preserve." And so the handling for corner cases gets lost.

Doing a new implementation that preserves all of the features of existing code in all scenarios is really hard. The re-implementation team never knows all the scenarios that matter.

Is AI going to fix this? AI won't know all the scenarios and corner cases, either.

Re:Problems with the Rust Language by pornel on Wednesday October 14, 2026 @09:46PM (#50098115)
1:1 rewrites from C are perfectly doable. You can use C FFI and rewrite function by function, bug for bug, while checking snapshot tests. I've converted a few libraries this way, before AI. I caught C bugs this way, and then was able to further refactor and improve the Rust version. In the end, I'm super happy with the results and I'm never touching autotools or cmake again!

The pool of C software worth rewriting is shrinking. There are the few too-big-to-rewrite projects that will never move, but everything else is either getting rewritten, or has more modern replacements already written directly in Rust.

I can't vouch for LLM-assisted rewrites. The results can be randomly dodgy regardless of what you're writing or rewriting. I suspect we'll get plenty more LLM rewrites anyway, and people will just compensate by sending LLMs hunting for bugs by brute force.

Re:Problems with the Rust Language by AnimalMuppet on Thursday October 15, 2026 @09:31AM (#50103436)
If you do a line-by-line rewrite, then my comments don't apply. If you do a clean-sheet rewrite, or even a function-by-function rewrite, then they do.
Re:Problems with the Rust Language by mike_hearn on Thursday October 15, 2026 @04:46PM (#50109971)
In fairness the rewrite of coreutils into Rust has been pretty chaotic. Lots of bugs in the new code that weren't there in the old, including security bugs.
Re:Problems with the Rust Language by steveklabnik on Thursday October 15, 2026 @04:51PM (#50110031)
It also did find bugs in the old code and contributed tests to their suite.
Re:Problems with the Rust Language by collinfunk on Thursday October 15, 2026 @06:40PM (#50111387)
They also copied some of our code, which is not very appreciated.