Need help?
<- Back

Comments (212)

  • stingraycharles
    Interesting to see this when the current top post on HN is someone worrying about Bun as it was acquired by Anthropic. The top comment there describes “Anthropic does experiments on their own codebase, the Bun team is not gonna do the same vibe coding experiments”.Yet here we are, what looks like a massive undertaking for vibe coding.Time will tell how this will turn out. Would be nice if the Bun maintainers could give some clarification about what they’re doing here, and why they’re doing this.
  • kgeist
    Interesting how times have changed. Back in 2015, the entire Go runtime (already a mature codebase) was rewritten from C to Go semi-automatically: one of the maintainers wrote a C-to-Go conversion tool (for a subset of C they used) so that it compiled and produced identical output, and then the resulting code was manually refactored to make the Go code more idiomatic and optimized. And now you can just ask a language model.The slides: https://go.dev/talks/2015/gogo.slide#3An interesting similarity:>We had our own C compiler just to compile the runtime.The Bun team maintain their own fork of Zig too
  • archargelod
    Linked commit is probably not the most convincing for this tagline. Here's a branch[0] of Claude mass rewriting Zig code into Rust which is currently at 773,950 additions and 151 deletions:[0]: https://github.com/oven-sh/bun/compare/claude/phase-a-port
  • hsaliak
    The problem with vibe coded re-writes is that you basically sign off on understanding the generated codebase at that point. Any historical knowledge of the codebase is gone.
  • jr-14
    I want zig to succeed but given that zig is not yet 1.x I'd imagine a large code base like bun would have difficulties addressing major breaking changes. Also given the fact that bun is using a fork of zig https://x.com/bunjavascript/status/2048427636414923250?s=20
  • tacitusarc
    I wonder if a successful, albeit slower, approach would be to walk the git commit history in lockstep, applying the behavioral intent behind each commit. If they did this, I would be interested in knowing if they were able to skip certain bug fix commits because the Rust implementation sidestepped the problem.
  • apatheticonion
    Having written a JavaScript runtime in Rust in the past - Rust is an excellent choice. Not just due to the development experience, but also for embedders who want to consume the project as a a library (rather than a binary, e.g. node).Not sure about vibe-coding it. While they aren't using v8, LLMs made it easier to understand v8 quirks and update v8 as they make weird changes every now and then. It couldn't write the runtime without help though.For those curious: https://github.com/alshdavid/ion
  • bijowo1676
    Its never been easier to rewrite X in Rust than today.Will everything eventually be rewritten in Rust and we finally achieve utopia?
  • inkysigma
    So I can't tell if the linked commit is an actual attempt or just an experiment but it did always strike me as odd to make a JS runtime in Zig when my impression was there were a lot of work-stopping compiler bugs at the time.
  • Humphrey
    I'll be very interested in how this AI port turns out. I am involved in a number of active projects that are being held back by the language / framework is holding back the project, but where a rewrite would be too big of a project to undertake by using only human power.I've had more success vibe coding Rust than I have in more dynamic languages. I suspect the strictness of the Rust compiler forces the AI agent to produce better code. Not sure. It could be just that I am less familiar with Rust so it feels like it's doing a better job.
  • classicposter
    https://github.com/oven-sh/bun/issues/30197It seems there was an issue where the image API ignored the ICC Profile.(now fixed) Any developer with experience implementing image formats would almost certainly avoid this mistake. This is a problem that cannot be solved with vibe coding. In this situation, the user is merely a guinea pig for bug fixes.
  • toledocavani
    For better or for worse, at least Bun is open source, and the world is not lacking a NodeJS alternative.What is the most interesting here for me is:- a big, clear outcome and acceptance criteria, vibe coding project on- a public, working, high performance, full featured, production codebase by- the leading LLM model maker known for the strongest coding abilityA good example no matter if it successes or not.
  • wg0
    If nothing, it'll be good marketing material targeted at non-technical enterprise executives so that they pressurize their engineering teams in meetings that look people are porting such complicated things from one different language to totally different language then why are we not using AI effectively?!
  • hbbio
    Given they have "unlimited" AI usage, do we expect the port to be complete tomorrow?
  • yladiz
    Why? Are there particular reasons that the maintainers of Bun feel the need to attempt to migrate from Zig to Rust?
  • elffjs
    Comparing this claude/phase-a-port branch with main: “Showing 1,646 changed files with 773,950 additions and 151 deletions.”
  • thayne
    When I first heard that bun was written in zig, I thought that was an odd choice for such a large project, mostly because the language is "unstable" and is still making significant breaking changes.I would guess dealing with breaking changes is a big motivation for this.
  • cropcirclbureau
    The only Bun shipped product I've used in anger is OpenCode and I regularly run into segfaults on it. I doubt this is the reason for migration but every time it happens, it reminds me the real cost of unsafe code. That being said, Zig is an absolute pleasure to write and I can't wait until it has a real library ecosystem, Rust's greatest boon.
  • thatxliner
    Didn't they write a whole blog post on why they chose Zig over Rust?
  • ngoquocdat
    I think they are simply experimenting to fully exploit Claude's models' powerful capabilities.
  • anymouse123456
    This is a huge loss for the zig language and community.As a fan of the language, I hope it leads to some reflection on things that might need to change moving forward.
  • heldrida
    I suspect that an experiment is being run. In any case, that'll be a hell of a story!
  • classicposter
    https://x.com/bunjavascript/status/1966806250827714736Haha, is it really okay not to retract that that the official account previously posted a caricature criticizing Rust?
  • ivolimmen
    I am not a fan of AI but my limited experience with running local small LLM's did show me that rewriting some scripts into a different language worked really well. So my guess is this will just turn out fine.
  • davidtranjs
    this isn't vibe coding. this is vibe rewriting. ~500k lines of code. nobody is reading those diffs line by line. nobody.
  • notnullorvoid
    Probably a good thing for the project even if the only net positive ends up being the Bun team stops maintaining a fork of Zig.
  • simultsop
    Which makes one think, why they did not buy deno at first place then?If they did, I guess they would rewrite deno in C++
  • arthurcolle
    Could just be an experiment or something. It's Monday, the week is young
  • confessinator
    Aside from Zig's anti-AI stance and maintaining their own Zig fork, I think this port will showcase that Anthropic can re-engineer a massive codebase.As an aside, I've been bitten by Zig's breaking changes on my own projects as well. It's taken the shine off of Zig and I'm looking at alternatives.
  • GianFabien
    Here we go again ...Company A buys company B. A's management decrees the henceforth B's aqcuihired team must comply with company A's standards.Second system effect kicks in. Bugs multiply.Half of original company B devs leave.I'm investigating whether future projects should revert to using Deno.
  • anon
    undefined
  • Animats
    How well does that long translation prompt work?
  • root_axis
    Any confirmation that a genuine port is underway? This might just be an experiment.
  • iamgopal
    the days are not far when golang will be ported to rust.
  • icase
    oh for christ’s sake
  • ratstew
    This feels more like a reaction to Zig's anti-LLM policy than anything. Anthropic would probably like to contribute something back to Zig at some point, but I doubt anyone would ever believe their PRs were not written by Claude.
  • forrestthewoods
    I hope they ship and use this. It’ll be a super interesting case study in a few years.
  • larpa
    "Claude, migrate bun to Rust, make no mistakes"
  • AbuAssar
    I fully support this decision
  • booleandilemma
    Interesting. When I thought of Zig, I thought of Bun. In my mind it was the flagship application for that language. Is there another? I wonder how the Zig team feels about this. To me it seems like Rust has definitively won now.
  • Capricorn2481
    April 26th - Bun announces they used AI to fork Zig so they could make an optimization for a 4x improvementApril 27th - Zig contributor mlugg clarifies why the specific optimizations Bun did were ill advised and wouldn't have been accepted in Zig, regardless of AI use [1]May 4 - Bun is looking into Rust as an alternative.This, to me, seems like total whiplash. Has anyone at Bun made a statement on why they're making such dramatic changes? It seems like the lesson to internalize from mlugg is not "switch to Rust"[1] https://lobste.rs/s/ifcyr1/contributor_poker_zig_s_ai_ban#c_...
  • sergiotapia
    >*No `tokio`, `rayon`, `hyper`, `async-trait`, `futures`.* No `std::fs`,I'm not a rust dev but even I kind of notice that tokio is kind of shunned in most projects. Why is that? Is it just bad or what?
  • anon
    undefined
  • matrix12
    it will make it more portable.
  • 0x142857
    you can use both zig and rust in a single project, duh
  • ConanRus
    instead of writing it once in C++
  • Amber-chen
    [dead]
  • y534y5
    [dead]
  • nothinkjustai
    Makes sense on merit. There really isn’t room for Zig when Rust exists, is more ergonomic, and also safe.
  • Entambi
    hahaha eat your heart out "don't port it to rust" gang
  • hakrgrl
    People are asking why they would switch from zig to rust. I wonder the opposite: why would anyone would use zig over rust?