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

  • talkingpumpkin@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    edit-2
    8 days ago

    I, for one, am glad they are volunteering as guinea pigs in an experiment to see how long a popular project can survive LLM slop.

    And if they harm javascript’s popularity in the process and projects start to look elsewhere… that’s an added benefit ;-)

  • abc@suppo.fi
    link
    fedilink
    arrow-up
    0
    ·
    8 days ago

    What makes him think it’s unreviewed? Any AI process worth its salt has several review steps.

  • HaraldvonBlauzahn@feddit.orgOP
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    9 days ago

    How much is one million lines of code?

    If a senior engineer works in a well-defined, well-architected greenfield project, and does extensive tests, 10,000 lines of code written in one year are very productive. The amount of new code per person-year will be much less in larger projects - a good indicator is the line count and the estimated value of the Linux kernel (40 million lines in 2025, redeveloping it in 2011 would have already cost 2200 million Euros, which would pay e.g. 36000 person-years for mid-level German software developers, that would mean 1111 lines per person-year{actually about half of that because of the interim growth of line count in the meantime }- and most software projects can only dream about so much actual value.)

    So, you can say 1,000,000 lines of code generated in 11 days are probably 100 person-years of technical debt.

    One caveat: It is relatively simple to auto-translate code in restricted languages like Java, Python, or Rust to unrestricted languages like C or C++. In that case, enforced invariants (like “no use of freed memory” or “sharing data across threads xor mutation”) become implicit, but verbatim translation is often possible.

    The other direction will require a re-design…

    • Eager Eagle@lemmy.world
      link
      fedilink
      English
      arrow-up
      0
      ·
      8 days ago

      you can’t compare the tech debt because it’s essentially a line by line translation from an existing codebase, not 1M brand new lines of code

      • ReptilianCleric@lemmy.zip
        link
        fedilink
        arrow-up
        1
        ·
        8 days ago

        That’s…irrelevant.

        Really. The specific details of the task doesn’t change that this was automated. Until it’s reviewed, it’s basically a pile of Schrödinger’s bugs and security holes. That’s the technical debt.

        • Eager Eagle@lemmy.world
          link
          fedilink
          English
          arrow-up
          0
          arrow-down
          1
          ·
          7 days ago

          It really isn’t. A line by line translation doesn’t introduce new logic and doesn’t change the system architecture. Saying it carries the same tech debt as brand new code is just not true.

          • anomnom@sh.itjust.works
            link
            fedilink
            English
            arrow-up
            1
            arrow-down
            1
            ·
            7 days ago

            Assuming the llm did it line by line without changing anything during an arbitrary hallucination.

    • HelloRoot@lemy.lol
      link
      fedilink
      English
      arrow-up
      0
      ·
      8 days ago

      that would mean 1111 lines per person-year

      not sure if I understand correctly, but this sounds off

      • HaraldvonBlauzahn@feddit.orgOP
        link
        fedilink
        arrow-up
        0
        arrow-down
        1
        ·
        edit-2
        8 days ago

        More like 500 lines per person-year.

        You can do the math yourself:

        • how many lines of code does the linux kernel have?

        • what is the estimated value of the kernel, which is the hypothetical cost to re-create it?

        • what do you think the seniority of a linux kernel developer is?

        • what annual salary do they make in the country which uses Linux most - the US?

        • now divide kernel value by annual salary to get man-years, and lines of code by man-years to get average lines of code per year

        Result: Typing in code that somehow compiles was never the bottleneck

  • Sibbo@sopuli.xyz
    link
    fedilink
    arrow-up
    0
    ·
    9 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
      ·
      9 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
          ·
          9 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
            ·
            8 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.

  • FishFace@piefed.social
    link
    fedilink
    English
    arrow-up
    0
    arrow-down
    1
    ·
    8 days ago

    Regardless of the truth of the matter, the Zig creator is being an unprofessional bell-end, and should let Bun fail on its own.

    • cecilkorik@lemmy.ca
      link
      fedilink
      English
      arrow-up
      0
      ·
      8 days ago

      No, AI psychosis has done so much damage to open source and software engineering as whole already, the professional thing to do is to start to call it out for what it is. And sometimes that means intentionally making people mad, like that project that instructed the AI to put self-disparaging remarks into the author’s PR to both mock the author and make it obvious they used AI. He may not be the hero we deserve, but he’s the hero we need right now.

      Maybe you do get more flies with honey than with vinegar, but vinegar is useful too. Fuck AI (at least in many of the forms it is currently being used and pushed in)

      • FishFace@piefed.social
        link
        fedilink
        English
        arrow-up
        0
        ·
        8 days ago

        If it’s doing “so much damage” - let them crash and burn. That’s all the vinegar you need.

        It’s different when it’s people coming and fucking up your project and breaking your rules - then they deserve to be dealt with robustly. But if all they’re doing is fucking up their own product then being a wretched little gossip doesn’t help anyone.

        • HaraldvonBlauzahn@feddit.orgOP
          link
          fedilink
          arrow-up
          1
          ·
          8 days ago

          By that logic, we would not need regulation for financial institutions because “the free market will sort it out”.

          Except that capitalism or the free market does not care about people. Only people, we ourselves, care about people. We need rules shielding off harm like the guests of a hotel need a fire safety system.