Login
You're viewing the functional.cafe public feed.
  • Nov 18, 2026, 6:41 PM

    At what point do we have to accept that the "rewrite it in rust" people might've had a point

    (Of course these days all attention around "rewrite it in rust" is about replacing good code with unreviewed slop, I'm not talking about that, but there was a hype in 2019-2022 to actually properly rewrite software in Rust)

    #rust #programming

    💬 3🔄 1⭐ 8

Replies

  • Nov 18, 2026, 6:47 PM

    @mort To play the devil's advocate, it didn't go that well for rust coreutils rewrite (I think it happened before the slop) and it was full of bugs and TOCTOU vulns.

    AFAIR that was mostly because the way to operate on files that prevents TOCTOU is through file descriptors/handles and rust fs APIs are structured mostly around paths.

    There was also something about not supporting paths that were not valid Unicode, because String type must be valid unicode

    Maybe this changed, I don't know.

    💬 2🔄 0⭐ 0
  • Nov 18, 2026, 6:50 PM

    @mort I don't want to sound defeatist (although maybe I am a bit on this topic) and think that the entire "rewrite in another language” is simply not enough to be the solution.

    💬 0🔄 0⭐ 0
  • Nov 18, 2026, 7:55 PM

    @mlen I am in favor of a Ruat coreutils rewrite, but I don't think Canonical's approach to it made sense.

    uutils was literally some person's side project that they used to learn Rust. That's not the right starting point for such a rewrite.

    I think Canonical (or anyone else) should've started a new open source project, where they started out by writing a safe Rust interface to POSIX APIs which makes TOCTOU etc easy to avoid, *and then* you can write a new coreutils on top of the new abstraction

    💬 1🔄 0⭐ 1
  • Nov 18, 2026, 7:56 PM

    @mlen Still, the problems with the coreutils rewrite are particular to that specific project. Rewriting memory-unsafe software in Rust can be a good idea in general even if a specific effort to do so makes mistakes

    💬 1🔄 0⭐ 0
  • Nov 18, 2026, 8:05 PM

    @mort I agree with both of your points. I was trying to make a point that just rewriting is not enough to make it good. Even in the days before the slop one could hear the claims that rust rewrites are better because they are in rust.

    💬 0🔄 0⭐ 1
  • Nov 18, 2026, 7:14 PM

    @mort
    Are you suggesting that we might not actually want the slop rust rewrites that contain thousands of uses of "unsafe"?
    But how else can we move to a modern software infrastructure?
    :-(

    💬 0🔄 0⭐ 0
  • Nov 18, 2026, 7:27 PM

    @mort 'Rewrite it in Rust' is only a valid thing to want to do if the original has memory problems or likelyhood of same. And then only if you UNDERSTAND the original. If the original has 30 years of bug fixes and learning subtle knowledge, then...probably there's something better to spend time on (and I agree with you on the llm-rewrites. That shit's never gonna produce good results, and may be safely ignored in this discussion).

    💬 1🔄 0⭐ 0
  • Nov 18, 2026, 7:52 PM

    @mhkohne I'm not sure there are many C code bases out there without a chance of memory/lifetime/int overflow bugs. There's Curl, but that's the exception I think

    💬 0🔄 0⭐ 0
  • Nov 18, 2026, 9:56 PM

    @mort I'll be convinced when Rust uses a compiler framework that is not slop-ridden itself and runs on all the platforms that gcc* does.

    (yes I know gcc has some slop in it… said slop was not retroactively applied to older releases though and gcc released before 2023 is perfectly fine for many things.)

    💬 0🔄 0⭐ 0