*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.

  • Sibbo@sopuli.xyz
    link
    fedilink
    arrow-up
    0
    ·
    10 days ago

    Sumner said the port was necessary given the growing number of bugs Bun users were finding, including one implicated in the recent Claude Code source leak.

    But the creator of Zig, Andrew Kelley, didn’t want his project to be seen as the culprit behind Bun’s woes, which he blames on Sumner’s bad programming practices.

    Ah, the old “blame the programmer” defense of low-level languages. By the same argument, why would anyone use Zig and not C? Do all Zig developers have bad programming practices?

    • Rimu@piefed.social
      link
      fedilink
      English
      arrow-up
      0
      ·
      10 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
          0
          ·
          10 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
            0
            arrow-down
            1
            ·
            10 days 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.