44 pointsby jottinger4 hours ago21 comments
  • elnatro4 hours ago
    Deno was already implemented in Rust, and not done by vibe-coding.

    Would you trust a fully vibe-coded runtime? Not some features, not some fixes, but a full translation from one language to another.

    • jillesvangurp3 hours ago
      If it has tests and responsible management, sure why not. I generally feel more comfortable if something is 1) widely used & scrutinized 2) managed competently. But that's orthogonal to how (not if) people use AI. Having good tests, reviews, etc. is much more important.

      Do people trust random NPMs developed by random people on the internet? Apparently we do given all the recent issues with supply chain attacks.

      I have a problem with people using vibe coding to refer to any contribution for which AI is used. I think it is inaccurate. People providing very low quality contributions to projects is a problem. But the real problem is people accepting such contributions.

    • embedding-shape3 hours ago
      Current feedback says: "yes", "hell no" and "no" so I guess I'll add this so we come full circle:

      It depends.

    • acomjean3 hours ago
      We had Fortran converted to ADA semi automatically at a place I worked.

      We called it Adatran.

      That code was weird and very hard to maintain. That goodness it was just small functions.

      • embedding-shape3 hours ago
        If you ran that converter multiple times, did you get the same output? I think that's the crux with automated codebase conversion via LLMs, I'd really want to focus on making everything as reproducible as possible first, not use a general agent and just vibe it together.
      • dvh3 hours ago
        Real fortran programmer can write fortran code in any language
        • classifiedan hour ago
          But only as long as they don't eat quiche.
    • Kiro3 hours ago
      Yes, but only because it is a translation. Easily the best use case for LLMs.
    • icase3 hours ago
      i don’t trust a translation to a trash language with a compromised compiler
    • amiga3863 hours ago
      hell no
    • 0x696C69613 hours ago
      Would you vibecode a house?
      • darkwater3 hours ago
        Would you vibecode a car?
      • spwa43 hours ago
        Yes, absolutely. In fact that's a big feature now in Autodesk. 99% of the design of a house is "detailing". Where does power line #8128 go? Does floor section 38 have the right slope? How big should water line #92 be and does it fit with sewage line #33 while it's sloping in the correct direction? We can't get electrical socket type 33, please modify everywhere in the design so we can use type 35 instead. And so on and so forth.

        Human architects and engineers make TONS of mistakes in these designs all the time. Then builders and contractors fix them, or in many cases "fix" them, as I'm sure most people here have experienced.

        Also if vibecoding houses can lead to a large increase in housing supply, as it should: Hurray!

    • julkali3 hours ago
      no
    • 3 hours ago
      undefined
    • janderson2153 hours ago
      hell yes
    • zeroCalories3 hours ago
      Depends on who vibe codes it. At the end of the day the Bun developers are the ones responsible for the quality of their software. If they've reviewed the code closely, tested it, and eat their own dog food, then I don't see why I should treat it any different from any other untrusted 3p dependency.

      IMO, the main problem with vibe coding is that it empowers reckless behavior at companies like Microsoft, and that people with no serious investment in outcomes are empowered to make things. Does that apply to Anthropic? The Bun team? It's not 100% clear yet.

      • andor3 hours ago
        They obviously haven't closely reviewed the code. That's the point
        • embedding-shape20 minutes ago
          Why is that obvious? Wouldn't surprise me either, but I don't think it's obvious, unless I missed some "confession" or something.
        • zeroCalories2 hours ago
          Then you would expect to see several related CVEs and outages related to this? How many? Would you be willing to bet on it?
    • damnnigga3 hours ago
      [dead]
    • scottcorgan4 hours ago
      yes
  • embedding-shape3 hours ago
    > The Rust rewrite passed 99.8% of the existing test suite. That number is enormous and significant, but let's be precise about what it actually says

    I'm having a hard time even loading the PR, so can't look myself... But I seem to remember that there was changes to the test suite as well as the rewrite to the Rust engine, that would mean this number may or may not actually be accurate. Anyone remember or could actually load the PR and see? That'd make this article weirdly under-researched and missing something kind of vital.

    • jottinger3 hours ago
      If I recall correctly - and I might not - the process found places in the test suite that were wrong or lacked clarity, and the suite was modified slightly in a few places to actually fix things that needed fixing. I don't think it was a broad enough change to actually significantly affect the coverage to a real degree, but then again, that WOULD be a good thing to dive into the PR to check - and as I've pointed out, I'm not a Bun user myself, so my main response to that is a vaguely-interested shrug and a nod towards what seems to be the bigger issue: the use of AI to do things performatively.
    • pmxi2 hours ago
      This will load the PR easily: https://diffshub.com/oven-sh/bun/pull/30412
  • reissbaker3 hours ago
    We've come full circle: now we have AI-written blog posts complaining about AI-written code.
  • woodruffw3 hours ago
    > For scale: uv, a Rust project of broadly comparable size from the same general corner of the ecosystem, contains 73.

    As a point of information: uv's use of `unsafe` largely involves interactions with OS APIs that don't have safe wrappers yet (in practice, this is mostly Win32 and similar APIs). It makes sense that Bun would have more `unsafe` than uv does, insofar as it needs to interact with JavaScriptCore's C API.

    (This is without making a value judgement; only to observe that the magnitude of `unsafe` across projects doesn't necessarily communicate anything without knowing what the `unsafe` is for.)

    • lunar_mycroft3 hours ago
      Bun has about twice the density of `unsafe` compared to deno, which does roughly the same job (wrap a c/c++ javascript engine to make a server side runtime written in rust). So not as massive a difference as the linked post's comparison, but still significantly more unsafe than we'd expect.
    • zeroCalories3 hours ago
      I would trust a zig -> rust translation far less if it didn't make liberal use of unsafe, because that implies an order of magnitude more aggressive refactoring
  • jt21903 hours ago
    > This is a measurement discipline: when someone offers you a test pass rate as evidence of a safety property, check whether the test suite measures that property. Behavioral equivalence and memory soundness are different axes. A green test suite tells you the new thing acts like the old thing. If the old thing was a body of manual memory management and the new thing is a faithful translation of it, then green tells you the translation is good - and tells you nothing whatsoever about whether the thing is safe. The number that would actually answer the question is the one nobody can produce yet, because producing it is, for now, an unsolved problem.

    Bottom line is we didn’t have a measurement of safety before the port, and we don’t have one now.

    What we do have is a known list of unsafe blocks, and we can use that as our safety measure. (I’m neither a Zig not Rust programmer, but I’m guessing that the unsafe parts of the Zig codebase were also mostly measurable so we could have had this measure.)

    I do wonder if the next step is to move bun into WASM for an additional layer of security. Those unsafe blocks might be neutered by not granting WASM the ability to run them. That would give anthropic a “sandboxed by default” opportunity.

    It’s a fun project to watch!

  • ianm2183 hours ago
    Posted this in a thread yesterday but seems relevant, I have been working on similar open source rewrites. Starting with Lua and Nginx. Trying to target idiomatic/ performant safe Rust from the start than straight porting and adding safety/ performance later.

    - Valkey/ Redis port here https://github.com/ianm199/valdr (passes ~99% of single node test suite, real prod features like replication/ clustering/ HA early or not implemented)

    - Further along port of Lua 5.1-5.5 https://github.com/ianm199/lua-rs-port/tree/main

    - I have a less developed nginx version that would be the North Star

    - These projects are very alpha at the moment.

    The thought was that we might need many “shots on net” in terms of software safety in the future so worth exploring.

  • voidUpdate3 hours ago
    How much of an architectural change does the borrow checker require? It feels to me like a pretty central part of Rust, and you can't just translate all the files one to one, then refactor out the unsafe blocks, it might need a full think through and project analysis to make it actually work with rust, instead of being forced into rust
  • pxtail2 hours ago
    So who will be doing upkeep and maintenance of the project, will developers who worked on this project need to learn Rust to be able to work with the codebase and be able to have correct judgement about changes done by LLM? If yes then will junior Rust developers be able to correctly assess PR's generated by LLM? Or developers will be fired and new team with Rust expertise will be responsible for the project now?
  • justinsaccount13 minutes ago
    > The Zig implementation that powered Bun is gone.

    The Zig implementation is literally still there.

    You can make predictions of what might happen in the future, but hard to take the rest of the article seriously when it has the basic facts wrong.

  • simonw3 hours ago
    > There is a small, ironic coda. The follow-up PR to delete the 600,000 or so lines of leftover Zig was titled, by Sumner, "ai slop." GitHub's automated anti-slop detection - built to flag exactly the kind of AI-generated mass change this was - caught it and auto-closed it. The author named his own cleanup slop, and the platform's tooling agreed.

    That looked suspicious to me (you could almost say hallucinated...), so I checked it out. Here's the GitHub Action that adds that comment - written by Jarred back in February, so it's not accurate to classify it as "GitHub's automated anti-slop detection". https://github.com/oven-sh/bun/commit/c01a5e08be896e1d1f4529...

    It was Jarred who deliberately added the slop label to that PR, which triggered the Action comment: https://github.com/oven-sh/bun/pull/30680#event-25523046939

    • jottinger3 hours ago
      Humans can make errors; part of why I waited so long to write and post this is because I'm not a great Rust coder (at all) and I don't use Bun, so I felt like I lacked enough relevant insight to say anything, and this is part of that, I think.
      • embedding-shape3 hours ago
        > Humans can make errors

        Sure, that makes sense, no one bats an eye over that.

        But this seems like a typical LLM hallucination, get the overall picture right, but misattributed where the actual work was done, this time it confused a GitHub feature for a feature of that particular repository, very common LLM mistake.

        I'd be curious to know, if you were actually the one who made this mistake, how it actually came about? When you looked into how the label/actions were working, how did you manage to confuse a Actions Workflow for a built-in GitHub feature?

        • jottinger3 hours ago
          Mostly because I finally figured out what I thought was relevant about the Bun port over the last couple of days, thanks to someone far more embedded in the ecosystem than I complaining about it. That complaint was the seed idea in the post, and shows up only remotely, because I thought the complaint itself was ranty and misplaced, but cast a shadow that actually interested me more.

          So I did some casual research, but used generalized numbers and impressions; I wasn't trying to pretend deep research, and some of the numbers (like the 99.8%) were drawn from publications and discussions that seemed not in debate.

          I am not an akshual journalist - I'm a systems architect who enjoys writing, who's served in a sort of journalistic role, and I sometimes write about topics that are not in my area of expertise. I don't write JS often myself; I've looked at Bun, particularly when it first came out, but my in-depth experience with it is minimal, so I'm writing everything from afar, and that includes the impression about the git interaction, which people wrote about and from which I inferred my conclusion, particularly because I didn't see the point of manually triggering the rejection.

  • ksec3 hours ago
    I am idly wondering, would it have made a difference if this was done over a month or two rather than say 9 days.

    If it was really a thought experiment, and the test suit was so good, and hopefully further improved after this. Could the same experiment be run translating to Go, C, C++, Pascal, Swift, Crystal or Ada?

  • losvedir3 hours ago
    I don't understand why they ported the Zig part. Wouldn't it have made more sense to have just unleashed the tokens on Claude Code itself, and eliminated the need for the bundled runtime altogether?
  • a-dub3 hours ago
    if anything, compilers and interpreters are probably the most suited for ai codegen as they have some of the most comprehensive test suites around and are relatively easy to verify.

    that said, it's a fun debate. sure, the rust compiler eliminated a whole class of memory bugs- but did the convoluted borrow checker gymnastics plus agent whoopsiedaisies leave behind a plethora of hidden and exploitable logic bugs?

    it'll be interesting to see, although we may never know as anthropic will probably use the latest frontier models to audit and quietly patch over the coming years.

  • Philpax3 hours ago
    The irony of a post about a port primarily written by Claude having been primarily written by Claude on a website primarily designed by Claude. Come on.
    • jottinger3 hours ago
      Claude (and Codex) designed the site, mostly because I'm not a UI coder; if I'd designed the site nobody'd want to read it but me, simply thanks to the UX.

      And I have a full-time job and more; I draft with an LLM's assistance and revise with another LLM (and other humans where possible) because I'm just arrogant enought o think that what I think might be useful to others. If it's not useful to you, I get it. Such is life.

      • ane3 hours ago
        Why can't you just publish the prompt instead? Do you not see how LLMs subtly alter your original message and erase your voice? They fill gaps that didn't exist, they create syllogisms that make no sense, and the voice is now so ridiculously AIdiosyncratic that it makes my eyes boil!

        If you have a message that takes 100 words to say, do not use a LLM to add 400 words to it, this isn't a school assignment! Stretching a spaghetti does not yield more spaghetti, it just makes a mess!

        Where is the value the LLM adds? Grammar? Vocabulary? The price you pay is you sound like everyone else and your original message is lost in the noise.

        • jottinger3 hours ago
          As far as publishing "the prompt" - there's no "the prompt." The draft was put together and expanded over a set of interactions with an LLM and other people over the space of about six hours. "The prompt" would have been about twelve pages long and unreadable. Funny as heck, but unreadable.

          (If you're really interested, you can check the logs in the site and find the actual interaction that started the article out. It was a comment from someone else, and it got me thinking.)

        • jottinger3 hours ago
          Heh. Funny thing: I've been writing online and professionally for literal decades, since around 2002 or so, and the LLMs tend to change my actual writing voice relatively little and usually in positive ways, since they say I meander too much.
      • Game_Ender3 hours ago
        Your process loses your unique voice. The content was OK, but too verbose, and needed data on other rust ports of similar scope.

        The issue is the quippy titles, “something - aside - continue” phrasing, and other constructions are feel like they or actually are wholly LLM written. I find a high correlation to this and low density fluff. The author did not have 10 paragraphs of things to say, but used an LLM to inflate a short outline to that. We would all of been better off with a tighter document - either human written or better prompted.

      • randomdev1233 hours ago
        It's not about that. Me as a reader wants to read you as a human, with all of its colors and nuances.

        These days due to usage of LLMs I developed (unknowingly) an LLM detector when reading these. I actually get distracted.

        So please, I believe you do have something to tell to the world, but please take it slower. No need to rush. I'd rather have something to read uniquely made by you.

      • Philpax3 hours ago
        I agree with the others - I'm sure that you've provided your own input, but Claude's writing and design style is so overwhelmingly dominant that those who have spent time with it can immediately recognise it, and it makes it hard to take at face value that you were the primary author, even if you were.

        For your workflow, I'd suggest drafting with a LLM to help you find the right balance of content, and then throwing all of that out and writing it yourself. Otherwise, it won't sound like you.

    • zeroCalories3 hours ago
      To be fair, who cares about ai slop websites? To be honest, they're often better than the average webdev garbage. Language runtimes are held to a much, much, higher standard.
  • sargstuffan hour ago
    Food for thought:

    Add a lambda fuction. Add list of condiments[0] such as let-us.

    Forage/prove one can have a turing complete meal with bun? Easier than risking indigestion through bun/sheaf correspondence.[1][2][3][4]

    ------------------------------------

    [0] : https://en.wikipedia.org/wiki/List_of_condiments

    [1] : Applied Sheaf Theory for Multi-agent Arificial Intelligence (Reinforcement Learnig) Systems: A prospectus : https://people.cs.uchicago.edu/~ericschmid/schmid-applied-sh...

    [2] : Discreate Morse theory for computing cellular sheaf cohomology : https://www2.math.upenn.edu/~ghrist/preprints/computationals...

    [3] : https://medium.com/@german_mag.ai/sheaf-theory-and-applicati...

    [4] : https://direct.mit.edu/books/oa-monograph/5460/Sheaf-Theory-...

  • fg1373 hours ago
    I always thought if they are vibe coding all the unsafe Rust code, they might as well keep it in zig, at least someone understands what they are doing. With Rust, when there is a CVE, chances are that nobody can even understand what the issue is, let alone fixing it.

    I for one am definitely going to stick to Node.js instead of taking my chances with Bun.

  • lukeweston12344 hours ago
    Couple of notes here:

    - This is blatantly irresponsible, and killed any credibility this project has

    - Comparing unsafe counts to UV makes no sense here.

    - There is already a strong, safe runtime that's not vibe coded, called Deno, that more people need to check out.

    - I am skeptical why Bun was even an acquisition target in the first place, other than pulling stunts like this.

    • nicce3 hours ago
      > - There is already a strong, safe runtime that's not vibe coded, called Deno, that more people need to check out.

      But people don't like the differences in the other feature parity. Otherwise they would already use it.

    • jolux3 hours ago
      Claude Code uses Bun.
      • lioeters33 minutes ago
        Why didn't they just rewrite Claude Code in Rust, and save everyone else the trouble of becoming the subject of their dramatic public experiment.
    • lunar_mycroft3 hours ago
      > Comparing unsafe counts to UV makes no sense here.

      Agreed. The better comparison is Deno, which does roughly the same thing (wrapping a c/c++ javascript engine to create a serverside runtime). Deno was smaller, but per line of code/file it had just over half the unsafe as the bun slop rewrite. There are also examples of unsafe blocks that are just locally incorrect [0], meaning you don't even need to read outside the function and it's definition to determine that the entity doing the porting (in this case claude) didn't understand how unsafe rust works.

      > I am skeptical why Bun was even an acquisition target in the first place, other than pulling stunts like this.

      From what I've heard, it sounds like the author had become fully hooked by LLM coding before the acquisition, so I don't think we know enough to conclude that this was premeditated by Anthropic. I think the more likely trigger is that Bun had just bragged about how they'd forked the zig language for a performance increase and attacked zig for it's no-AI policy, only for a zig core team member to point out that the code couldn't be upstreamed even if it had been hand written [1].

      The better point, IMO, is how this is an example of how AI use/addiction makes developers who fall into it loose the ability to judge code quality, particularly for code they prompted for themselves. From what I've heard of Mr. Sumner and the team at oven from before AI, I very much doubt code of this poor quality would have been allowed anywhere near the main branch before LLMs.

      [0] https://github.com/oven-sh/bun/blob/d2a6506dfad4c3ef3dddb9ae...

      [1] https://ziggit.dev/t/bun-s-zig-fork-got-4x-faster-compilatio...

  • petesergeant3 hours ago
    This feels confused. The point is surely that memory-safe code can now be written, where the article seems to focus on the fact that it hasn't been yet.
    • lunar_mycroft3 hours ago
      Yes and no. In theory, you could start to go through an factor out unnecessary unsafe blocks from the codebase now. In practice, writing safe rust often requires significantly different design decisions than writing in garbage collected or fully manually memory managed languages, especially if you want the results to be performant. There's a very good chance you'd be better off rewriting from scratch than trying to do a 1:1 translation/port.
  • classifiedan hour ago
    You now need a carry permit and a casino license to run bun because it has become indistinguishable from Russian roulette.
  • cpursley2 hours ago
    Well, that’s an easy one: start converting all the node dumpster fires into rust as well. Especially the electron apps…
  • jottinger4 hours ago
    Bun was ported from Zig to Rust by an LLM and passed nearly all its tests - while shipping more than ten thousand unsafe blocks. Memory safety is the main reason you'd pick Rust. So what did the rewrite actually accomplish?
    • ivanjermakov4 hours ago
      Were "passing tests" also generated by the same LLM?

      This is much different from how Ladybird team handled a rewrite: https://news.ycombinator.com/item?id=47120899

      • simonw3 hours ago
        > Were "passing tests" also generated by the same LLM?

        No. The useful thing about porting a language runtime is that most of the tests are written in the language that it's a runtime for, not the implementation language. It's very easy to catch if the coding agent rewrites those tests.

        • ivanjermakovan hour ago
          I heard that Bun is not just a JS runtime, but much more than that. JavaScriptCore (JS engine Bun uses) is property tested outside of Bun anyways, what about other stuff?
    • ramon1564 hours ago
      Preparation, but this is prep for a scale that the maintainer is going to solve by more LLM-assisted coding, probably.

      Unsafe blocks are not inherently bad, but it's good that these are explicit unsafe blocks. It's like saying TODO comments are bad. It depends.

    • onlyrealcuzzo3 hours ago
      > So what did the rewrite actually accomplish?

      Hype.

      On an aside, isn't Zig supposed to have much faster compile times than Rust, and didn't they give that as the main reason Zig wasn't working for them and why they wanted to switch to Rust?

      The whole thing seems insane. I don't know why anyone would switch to Rust for any reason besides the obvious: to get REAL memory safety.

      If you're doing that... You wouldn't wrap ~90% of your important code in `unsafe` blocks.

      You're doing a ton of work for virtually no benefit, and - if anything - a lot of negatives.

      Everything I've read and heard about this port raises more questions than answers, and not in a good way.

    • rcxdude3 hours ago
      It's generally best to do the port as directly as possible, even if the resulting code is ugly in the target language, then refactor to fit the new language better. Doing both at once can make things a lot more difficult. (With porting you generally want to have as little time as possible where everything is 'in pieces' and the port is non-functional, hence why gradual processes are usually required for larger projects)
      • mpalmer3 hours ago
        It's generally best to do several things that no one did here.
    • dralley3 hours ago
      Considering a substantial fraction of the commit history since then has been removing those instances of "unsafe" not all of are actually usages of "unsafe" (seems like there are a fair number of functions / types with unsafe in the name but not the signature), is that actually still true?

      And if nothing else Rust forces you to document where they are, which isn't nothing.

    • nicce3 hours ago
      > So what did the rewrite actually accomplish?

      Great marketing stunt for Claude Code. Let's see later what is the result. But IPO is already over then...

    • jakelazaroff4 hours ago
      For one, you now know exactly where the memory unsafe code is, rather than a cloud of suspicion hanging over every line of the codebase.
      • gspr3 hours ago
        Sure, as long as all the code in all those unsafe blocks is sound! If not, the program is UB and all bets are off for every line of the codebase.

        I think Rust strikes a perfect balance between a safe default and, as you say, "localized unsafety". Said localized unsafety is however only localized as long as you're "doing it right". I would absolutely not trust an LLM to do it right for hundreds of thousands of lines of translated code. This is insane.

        • jakelazaroff3 hours ago
          Right, but the point is that you now have an explicit todo list of blocks to fix. You can trivially enumerate all sources of unsafety, and when a grep for unsafe blocks turns up empty you know your codebase is memory safe. When could you say the same about your Zig or C/C++ codebase?

          I'm writing this as someone who doesn't even really like Rust; I'd probably prefer to write Zig! But those unsafe blocks definitely buy you something.

          • gspr3 hours ago
            For normal use of unsafe in Rust, I completely agree, and I love the concept. But if you have a gazillion unsafe blocks written by someone (something) you don't trust to at least try to do the right thing, you're bound to have unsoundness in one of those blocks. And now your entire codebase is UB.

            I don't see how this is any different from every line trailing with a comment of the form "FIXME: This line might be wrong".

            And I say this as something of a Rust fanboy. I love the way unsafe blocks work, and the "locality of danger" they give you. But that all goes out the window if there's a gazillion haphazardly written such blocks.

            • jakelazaroffan hour ago
              They have a gazillion such blocks today. If they still have a gazillion such blocks in a year, sure. But presumably the plan is to replace them with safe Rust.
    • 151554 hours ago
      - A substantially simpler, more-contained build process

      - A base from which to build upon by removing unsafe blocks

      • gspr3 hours ago
        > - A base from which to build upon by removing unsafe blocks

        This is nonsense if those unsafe blocks are unsound to begin with.

    • throw73 hours ago
      Value to Anthropic's shareholders.
    • maipen3 hours ago
      I see comments like this and they seem so pointless. The port was done in a week. Do you think the development is finished? Obviously there are some unsafe blocks that will remain forever unsafe. But other will eventually be removed.

      Just a bunch of fearmongering