*The Rustification of Bun#

Rewriting 500,000 lines of Zig into another language would be a gargantuan undertaking if done by hand. “A rewrite in another language would take a small team of engineers a full year. It would mean freezing bugfixes, security fixes or feature development for that time,” Sumner wrote.

Instead, Sumner went with Claude. He spun up about 50 dynamic Claude Code workflows, reaching a peak of about 1,300 lines of code per minute and generating over a million lines of Rust code. The job took 11 days and cost about $165,000 at API pricing. Claude Fable did most of the heavy lifting.

  • Rimu@piefed.social
    link
    fedilink
    English
    arrow-up
    44
    arrow-down
    1
    ·
    2 days ago

    Apparently Bun was always an especially bad example of how to use Zig.

    From https://andrewkelley.me/post/my-thoughts-bun-rust-rewrite.html

    The Zig team regularly checks in on our users’ projects. We read source code to find out how the language is affecting users, we test changes to see how problematic breakage might be, and we check for performance regressions.

    We became increasingly horrified at the programming practices we saw in Bun’s codebase. Hacks on top of hacks. Abuse of assertions. Most of all, recklessly speeding past feature after feature with very little time taken for reflection and elimination of bugs and technical debt. Jarred was already writing slop well before he had access to LLMs. Now, it’s not our business to police what our users do, but you may have noticed people screaming in our faces about memory safety constantly. You can imagine how we might want to put some social distance between ourselves and a project whose irresponsible software engineering practices invite the exact kind of criticism that people are eager to level.

    We made futile attempts to guide them towards better programming practices. There were a few exceptional heroes who did their very best in a dysfunctional company. You know who you are. But you can’t stop a rising tide.

    By this time, we all felt at ZSF that Bun was a net liability, and this was before RoboBun became the #1 contributor.

      • Glitchvid@lemmy.world
        link
        fedilink
        English
        arrow-up
        14
        ·
        2 days ago

        Double sucks because it’s also being used as a proxy flamewar between Zig and Rust enthusiasts.

        Which is awful because there are good conversations and teachings to be had between those languages; but instead all of the circumstance is just blood in the water and completely unproductive.

        • ISO@lemmy.zip
          link
          fedilink
          arrow-up
          5
          arrow-down
          3
          ·
          edit-2
          1 day ago

          Zig is too irrelevant, both technically and adoption wise, for anyone actually relevant to be fighting over it. The number of notable Zig projects went from 3.5 to 2.5 recently 😉. Hell, Zig probably has more adoption as a build tool, than as an actual implementation language (I would take it over CMake any day of the month tbf).

          Hell, WIP languages experimenting with effect systems and/or similar next-gen concepts will probably hit v1.0 before Andrew thinks Zig is ready for a v1.0, which is in his forte, but no one should be holding their breath if they are not aware of some history and personality details. Since Andrew tagged Zig v0.1, the Rust project designed the edition mechanism, introduced three inter-compatible editions (four if you include 2015), and managed on-schedule ~66 1.n minor releases, and in the process grew into a semi-popular language impacting almost every corner of the industry.

        • vanillama@programming.dev
          link
          fedilink
          arrow-up
          2
          ·
          1 day ago

          Let’s hope after this is done we can have more productive conversations. There’s so much potential for all of us to learn, or at least definitely for me.

    • hirihit640@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      2
      arrow-down
      3
      ·
      22 hours ago

      This sounds like Kelly is giving the “you’re holding it wrong” argument.

      Languages like Rust make it hard to run into memory bugs. C and Zig don’t protect you. Here is a good article about Zig vs Rust memory safety. If your language allows you to easily write memory unsafe code, then your language is partially to blame.

      It’s like why we have type systems. Sure, you could write bug-free code using untyped python. And you can blame somebody for “coding too fast” if they end up with a lot of bugs. But a well designed language with a well designed type system, could have prevented many of those bugs from being written in the first place

      • vanillama@programming.dev
        link
        fedilink
        arrow-up
        5
        ·
        20 hours ago

        To a degree, sure, but going out of your way to go against convention even for the language itself is also to blame if Kelly is right. It’s less about whether you add type annotations to python, and more about following conventions and writing python in a way that a random developer with enough python experience would be able to understand and contribute to the codebase. I’ve seen anti patterns in a handful of languages I know well enough and it’s easy to tell the other person didn’t bother practicing enough and learning basic conventions.

        • hirihit640@sh.itjust.works
          link
          fedilink
          English
          arrow-up
          1
          arrow-down
          2
          ·
          14 hours ago

          Coding conventions are fine but generally the language should enforce them by design. This is the difference between Rust and Zig. In Zig, you can ignore memory safety. In Rust you can’t (or rather, it’s hard to). Type systems are the same, you generally can’t just ignore the rules. The compiler will complain.

    • badmin@lemmy.today
      link
      fedilink
      arrow-up
      3
      arrow-down
      5
      ·
      1 day ago

      My friend just got dumped. And from what she’s telling me, he is the worst person ever.

      kek