7 votes

Bun has been rewritten in Rust

7 comments

  1. [4]
    omid
    Link
    Wow that’s a huge PR! GitHub comments (just GitHub in general I guess) are really struggling to load right now, but judging from the tags here it seems the rewrite is heavily AI-assisted? Perhaps...

    Wow that’s a huge PR! GitHub comments (just GitHub in general I guess) are really struggling to load right now, but judging from the tags here it seems the rewrite is heavily AI-assisted? Perhaps entirely done by AI agents?

    3 votes
    1. [3]
      largepanda
      Link Parent
      Not assisted, done entirely by Anthropic's Claude.

      Not assisted, done entirely by Anthropic's Claude.

      3 votes
      1. Eji1700
        Link Parent
        This is not wrong, but I do want to be clear that a huge reason this was so successful is because of a very well written and detailed test suite. AI works wonderfully when it can determine its...

        This is not wrong, but I do want to be clear that a huge reason this was so successful is because of a very well written and detailed test suite. AI works wonderfully when it can determine its wrong, and it can't flub the test.

        1 vote
      2. Weldawadyathink
        Link Parent
        Not just Claude, but most likely Claude Mythos. Bun was bought by anthropic because it's used for Claude code, so they almost certainly have free access to Mythos.

        Not just Claude, but most likely Claude Mythos. Bun was bought by anthropic because it's used for Claude code, so they almost certainly have free access to Mythos.

  2. [2]
    arqalite
    Link
    It doesn't load on my end - but like, what's the point of this rewrite? Is Bun so slow that Rust was needed here? Did it provide a measurable performance improvement? I had the impression that Bun...

    It doesn't load on my end - but like, what's the point of this rewrite?

    Is Bun so slow that Rust was needed here? Did it provide a measurable performance improvement? I had the impression that Bun is the faster of the JS tools.

    I am genuinely in love with Rust, so the more big projects in it the better, but I'm also a practical person, and rewrites are not always the best idea, unless the architecture was flawed or the stack was just so awful.

    1 vote
    1. Eji1700
      Link Parent
      Memory safety. Rust has stronger rules for this, and the lead dev straight up cited tons of time dealing with segfaults as the reason for the jump. There are other arguments that it's because...

      It doesn't load on my end - but like, what's the point of this rewrite?

      Memory safety. Rust has stronger rules for this, and the lead dev straight up cited tons of time dealing with segfaults as the reason for the jump.

      There are other arguments that it's because since anthropic acquired bun and Zig is heavily anti AI anything in their code base that this was another reason because they couldn't contribute to Zig development, but i haven't looked into that side so grain of salt. I have no idea how much of that is true or not.

      Edit:

      Last comment I read from them on HN:

      Still writing the blog post about this. Will share more details.

      For where this is coming from, skim the bugfixes in the Bun v1.3.14 and earlier release notes. Rust won’t catch all of these - leaks from holding references too long and anything that re-enters across the JS boundary are still on us. But a large % of that list is use-after-free, double-free, and forgot-to-free-on-error-path, which become compile errors or automatic cleanup.

      1 vote
  3. devalexwhite
    Link
    Man what a waste of electricity. Now there's a PR filled with so much crap nobody can review it, which means bugs will absolutely be introduced. For what?

    Man what a waste of electricity. Now there's a PR filled with so much crap nobody can review it, which means bugs will absolutely be introduced. For what?

    1 vote