19 ms·
Rewriting Bun in Rust
- AbuAssar 2mo agoIt took TypeScript team 1 year to port the code to Go, but if Claude Fable was available back then, would they better use it to port the code in 1 week instead?
- classicposter 2mo agoThis slop rewrite introduced new vulnerabilities and regressions.
- wilkystyle 2mo agoCare to elaborate?
- minimaxir 2mo agoAdding bespoke animations via Claude Code to the blog post is definitely thematic. It's unclear if they're useful data visualizations as they take a bit of time to parse, but they're neat.
- thevinter 2mo agoOne thing that I found interesting is that most of the discourse surrounding the topic happened with the assumption that the rewrite was happening with an Opus-like model, and not with Fable. Those assumptions, at least partially, were used as arguments against the fact that the rewrite was feasible and/or a good idea. Clearly the model itself doesn't completely change the narrative, but at least as a note to myself, I would like to be more careful with assuming the capabilities of the models used internally by Anthropic and affiliated orgs.
- cube00 2mo ago> the assumption that the rewrite was happening with an Opus-like model, and not with Fable I thought the same thing. Looking back, I was probably mislead in May when Jarred was explaining the pattern to "Rewrite every .zig file to .rs" as if it was something I could have done in May following his pattern. What he wasn't telling us was he was using pre-release Fable. [1] A possible signal for next time is when we see an Anthropic owned company disabling the Claude Co-Authored-By trailer. [2] In an IPO year they have to take every chance to promote Claude unless it was something (Fable) that we weren't supposed to know about back in May. [1]: https://xcancel.com/jarredsumner/status/2060050586024743376#m https://xcancel.com/jarredsumner/status/2060050586024743376#... [2]: https://github.com/oven-sh/bun/commit/23427dbc12fdcff30c23a96a3d6a66d62fdc091d https://github.com/oven-sh/bun/commit/23427dbc12fdcff30c23a9...
- guardiang 2mo agoSilly assumption, Mythos was available at the time. Benefit of the doubt should've gone to Jarred.
- rvz 2mo agoAs expected [0] [1], this was a clear advertisement / marketing opportunity of Anthropic's Fable model on rewriting Bun (which powers Claude Code) from Zig into Rust. Something that would have taken hundreds of developers now took 1 developer with Fable. Now Claude, rewrite Claude Code from TypeScript to Rust. Make absolutely zero mistakes. [0] https://news.ycombinator.com/item?id=48073893 https://news.ycombinator.com/item?id=48073893 [1] https://news.ycombinator.com/item?id=48240829 https://news.ycombinator.com/item?id=48240829
- steveklabnik 2mo agoEDIT: the parent has effectively deleted their original comment > There are a lot of ways to do a terrible job of this. For example, prompting Claude "Rewrite Bun in Rust. Don't make any mistakes." and then praying it would work is not what I did.
- rvz 2mo ago[flagged]
- steveklabnik 2mo agoHacker News does not have a meme-y culture, and this post takes this topic pretty seriously and is technically interesting. It's not so much that I missed that it was a joke, I just don't think that it really added to the discussion. What you've edited it to is a much better comment.
- rvz 2mo ago[flagged]
- QuaternionsBhop 2mo agoJokes require mutual context. You failed to create a joke because you did not ensure the prerequisites were met.
- Philpax 2mo agoWithout commenting on Bun itself as a project, or the nature of the rewrite, it can't be good for Zig that a naive rewrite away from it fixed memory leaks, improved stability, shrunk binary size by 20%, and improved performance by 5%.
- bielok 2mo agoI would guess that people looking to use Zig understand that those are project concerns and not language concerns.
- pyrolistical 2mo agoYeah but they turned it into something unreadable. Call it a skill issue if you wish. I just haven’t found another language that just makes sense. Zig doesn’t hide anything from you
- lifthrasiir 2mo agoThe article explicitly mentions the maintainability as a foremost concern.
- silver_silver 2mo agoPeople say a lot of things, especially when they have a vested interest in a positive outcome. Bun has been fully vibe coded into another language. There’s no way in hell it’s maintainable. Go read any analysis of the Claude Code leak for proof.
- fernando-ram 2mo ago[flagged]
- gpm 2mo ago1. There's no comparison - it's just showing a snapshot in time (apparently post port). You literally can't!? 2. Of your 8 comments on this site, 7 are spamming links to this site. I at least don't think that's ok.
- fernando-ram 2mo agoYeah, thats on me I got a little lazy. Im not trying to spam, It my project because I think its cool to see projects this way and I think it can make software more digestable and less nebulous a concept
- fernando-ram 2mo agofixed it
- bel8 2mo ago> Claude Code v2.1.181 (released June 17th) and later use the Rust port of Bun. It seems the reports of Bun's death have been greatly exaggerated.
- deleted 2mo ago[deleted]
- duhhhhh1212 2mo agoWhere is the cost breakdown? I feel like this would be the easiest number to determine and write in this post. It's hard to believe that there have been no problems/downsides since the port.
- gpm 2mo ago> Where is the cost breakdown? From the article > Pre-merge, this took 5.9 billion uncached input tokens, 690 million output tokens, and 72 billion cached input token reads — around $165,000 at API pricing > It's hard to believe that there have been no problems/downsides since the port. A significant portion of the article was dedicated to the 19 regressions they've found. Starting here: https://bun.com/blog/bun-in-rust#porting-mistakes https://bun.com/blog/bun-in-rust#porting-mistakes
- duhhhhh1212 2mo agoThanks!! Those are solid numbers but confusing. He reported input, output, and cached input token reads but not cache writes/cached creation input tokens? Maybe cache writes aren't a thing internally?
- BearOso 2mo agoI posted on an older article that I thought it probably cost half a million in API pricing. 165k USD is a lot lower. I wonder what the actual compute cost was. When this first hit the news, Opus 4.7 was brand new and required 6x the compute power per user token vs 4.6. The article says they were using Fable, which is way more expensive.
- dfabulich 2mo agoThis blog post further undermines my trust in Jarred. He makes it sound like Claude did a fantastic Rust rewrite, and "the work continues." But when the Rust port merged to main, the state of the code was very, very bad. There were 13,000 instances of `unsafe`, no Miri tests at all, and, sure enough, it exposed UB in safe Rust. https://github.com/oven-sh/bun/issues/30719 https://github.com/oven-sh/bun/issues/30719 Observers could see this coming from a mile away, objected strongly to using AI to RIIR before the code merged. Rather than incorporate feedback and get the code ready for production, Jarred gaslit us all, right here on HN. https://news.ycombinator.com/item?id=48019226 https://news.ycombinator.com/item?id=48019226 Just 9 days before he merged the Rust rewrite to the main branch, Jarred wrote: > This whole thread is an overreaction. 302 comments about code that does not work. We haven’t committed to rewriting. There’s a very high chance all this code gets thrown out completely. It's plausible that Bun's Rust rewrite is now in much better shape than it was in May. But a blog post like this would have been a place to apologize, to accept that it was a very bumpy rollout, to acknowledge that public messaging was extremely poor, and to earn back our trust. As it stands, I guess I'll have to run my own tests to try to evaluate whether Bun 1.4 is ready for prime time, because I just can't trust Jarred to give us a straight answer.
- Georgelemental 2mo agoPre-release code had bugs that were fixed before the release? Why is that a problem? That's the point of having a testing and release process
- pier25 2mo agowhat about new bugs introduced after the rewrite?
- cognitiveinline 2mo agoGot a reference to something specific? Per the blog post the overall quality, speed and size all improved. And multiple users have corroborated. Like have you run into a specific bug or seen a regression - that's the cause of your reaction?
- theLiminator 2mo agoThat's the power of a strong test suite. LLMs excel when you have verifiable rewards. I imagine we'll get a lot more rewritten in rust projects in the future. Rust is also an ideal target for such rewrites as it offers a lot of verification (via its type system) and is low overhead with zero-gc. There's less and less reason to use GC'd languages in the agentic coding era. I think Rust is a locally optimal target for LLM coding, we might see a better language in the future, but I think Rust will dominate for quite some time.
- lifthrasiir 2mo ago> There's less and less reason to use GC'd languages in the agentic coding era. Faster iteration, maybe? Rust's safety guarantee isn't exactly free (while still being very excellent) and does affect iteration time. I have a private project (>300K LoC) that has been translated from Python to TypeScript and the reason we couldn't use Rust was definitely the iteration time.
- gpm 2mo agoEh... rust's safety isn't free, but not having it and wasting time on "oh I forgot to change this call site" also isn't free. On the whole I'd say the safety assists in iteration time. What costs rust in iteration time in my opinion is the low level (by default) nature of it. There's a faster-to-iterate language that has yet to be created which is rust but we sacrifice performance (and memory fiddling ergonomics for the odd person who does that) so we don't have to worry about things like whether a variable is stack or heap allocated. Which is in the direction of a GCed language but retains the mutable-xor-aliasable semantics. Between rust and current GCed languages though... I guess I agree with "maybe" in both directions.
- theLiminator 2mo agoMaybe something like Hylo? But personally I don't see anything displacing rust for the next few years, as I think there's enough rust in the training data for it to be the best "serious" language for agentic systems-level development. It's really the only systems language in its exact niche.
- YuechenLi 2mo ago>Combined with the Rust rewrite, ICU changes, and identical code folding, Bun's binary size shrinks by ~20% on Linux & Windows. People who are surprised by this probably has not seen what Zig code actually looks like. Zig's explicitness and lack of abstraction have a real cost that it is basically one of the most verbose programming languages I've ever seen, it's somehow even more verbose than Go. Basic features of modern languages like pattern matching and generics, and as you can see, having to manually clean up everything means that if you forget once, it's a memory leak. Having SOME abstraction is actually good if it prevents you from making mistakes. Ironically, Zig is a programming language that's probably best written by LLMs, since they can actually tolerate the verbosity.
- benced 2mo agoNot a compiler expert - shouldn't language verbosity and binary size be, at best, very loosely related?
- steveklabnik 2mo agoI don't think you can draw the conclusion that source length and binary size are correlated. For example, in Rust: #[derive(Copy, Clone)] enum Expr { Int(i32), Add(i32, i32), Neg(i32), } fn eval(expr: Expr) -> i32 { match expr { Expr::Int(x) => x, Expr::Add(a, b) => a + b, Expr::Neg(x) => -x, } } Rust's enums can carry data. You can write the same thing in C, but because it does not have the enum feature, you have to do it yourself. They're sometimes called "tagged unions" for a reason, you use a union + a tag when doing it by hand: #include <stdint.h> typedef enum { EXPR_INT, EXPR_ADD, EXPR_NEG, } ExprTag; typedef struct { ExprTag tag; union { struct { int32_t value; } Int; struct { int32_t left; int32_t right; } Add; struct { int32_t value; } Neg; }; } Expr; int32_t eval(Expr expr) { switch (expr.tag) { case EXPR_INT: return expr.Int.value; case EXPR_ADD: return expr.Add.left + expr.Add.right; case EXPR_NEG: return -expr.Neg.value; } __builtin_unreachable(); } I haven't actually compiled this, but it should compile to almost the exact same, if not literally the exact same, machine code. Yet one is way more verbose than the other.
- ianm218 2mo agoInspired by this project I ported most of Valkey to Rust here valdr.dev . The coolest outcome was being able to run a redis comparible store on an a cloudflare durable object so you do I.e. rate limiting for free with little infra.
- giancarlostoro 2mo agoSo I kept hearing that the author did this purely because Anthropic wanted a PR story, but reading this entire very well written post, with meticulous detail, what say you now? I never thought it made any sense for him to do this just because Anthropic asked him to. Sometimes you find yourself fighting the stack you're currently using, and another stack (or programming language) looks like it would alleviate a lot. LLM was just another tool in his toolbelt. I had already ported projects that were old and abandoned before using Claude Code, so I knew it was possible.
- nozzlegear 2mo ago> what say you now? I think that when you have a $165,000 hammer, all of your problems begin to look a lot like nails.
- giancarlostoro 2mo agoI've done rewrites like this, maybe it wasn't Zig to Rust, but I have been able to rewrite sizable projects, from C# to Rust before. I incorporated a similar strategy, have Claude Opus review the codebase, write a spec, then have Claude implement it, while reviewing the spec, and using the codebase as fallback and gospel over the spec. That said, it's not the entire story here as I said, there was a lot of thought put into it, it it had not been done with Claude, I have a feeling he might have started an "experimental" version of Bun in Rust instead, as many developers have done in the past before LLMs.
- MindSpunk 2mo agoCurious why you'd move from C# to Rust. C# has you covered mostly for memory safety so I would guess performance or lots of shared memory across threads?
- ultimaweapon 2mo agoNot the author but I also moved from C# to Rust. In the first place I did not consider Rust for C# works like REST API but after I proficient with Rust I no longer want to work with C# for the following reasons: 1. Microsoft don't want to open source .NET Core debugger. 2. I tired of keeping upgrade .NET on my projects. 3. Result type in Rust make me more productive than exception in .NET. 4. async/await in Rust is lightweight and a better than .NET. 5. Thread-safety in Rust is a compiler error instead of figure out by checking the docs if type is thread-safe. 6. Community libraries in Rust has a great quality and docs.
- hansvm 2mo agoEvery time I've rewritten a major project I've made it smaller and faster while fixing all the major bugs and most of the minor ones. My current team has had similar experiences. I'd be curious to see what a Zig -> Zig rewrite of the same magnitude would have done for quality.
- tangenter 2mo agoShould we brace for another front page Zig donation announcement? A fast follow with a “Why Zig?” penance piece, replete with anecdotes about how it is the only true way to express oneself?
- SergeAx 2mo agoI still think that generating a Zig-Rust transpiler would be a better approach, given all the LLM quirks, including the ability to just /goal the model with binary-identical LLVM bytecode. However, an open-sourced tool like that would've greatly harmed the Zig ecosystem and community.
- ivanjermakov 2mo ago> would've greatly harmed the Zig ecosystem and community People looking to abandon the ship first chance are unlikely to contribute much to the ecosystem and community.
- leecommamichael 2mo agoGo famously used machine translation to remove dependency from C. It's a nice way to retain structural familiarity with the target language. I imagine they could've saved a large portion of that $165,000 using this route. Hard to say for certain, though. You wouldn't want to scope that transpiler at "being able to transpile all programs generally," and so scoping the project does become a serious task.
- pier25 2mo ago> Compiler errors are a better feedback loop than a style guide So essentially this whole re-write was about making Bun LLM compatible.
- didibus 2mo ago> to exhaustively come up with reasons why the changes create bugs or do not work My biggest issue currently, is I can't seem to get a code review that's about the simplicity of the code, and no /simplify ain't it. Removing certain bugs and generally working seems to be doing alright, especially if it's following either an example code (like in the Bun rewrite case) or a well defined "spec" of how to proceed.
- himata4113 2mo agoThey didn't mention the cost of this. Assuming mythos was somewhat involved I'd extrapolate this as: 128 x20 max accounts needed which comes at $25.6k or over 75k in api costs. For 75k you can hire a team of engineers that would produce a better result with sematic conversion and other tricks used in porting from language A to language B at the cost of maybe taking 1 month instead of 10 days. I will be a lot more excited when this is possible with <10k of api costs.
- fps-hero 2mo ago> Pre-merge, this took 5.9 billion uncached input tokens, 690 million output tokens, and 72 billion cached input token reads — around $165,000 at API pricing. By hand, I think this would've taken 3 engineers with full context on the codebase about a year, during which time we wouldn't be able to improve Node.js compatibility, fix bugs, fix security issues or implement new features. We never would've done that. The realistic alternative was to do nothing and keep fixing the bugs at the top of this post forever.
- erichocean 2mo agoEven at $165K, it's worth it to have a better base to build on top of—especially since it didn't take a year's worth of time for three programmers.
- incognito124 2mo agoIt states $165k in the article
- JavierFlores09 2mo agoI don't think the realistic alternative here was “hire a team for a month and get a better semantic conversion” For a rewrite of this size, the expensive part is deep understanding of the underlying system in order to preserve behavior while keeping performance, and above all that not freezing product work while doing it. Adding more engineers would just end up in managerial burden and review bottlenecks, to say the least. So even assuming the API cost estimate is high, I don't buy the “just hire engineers for a month” take. A team unfamiliar with the codebase would probably spend a large chunk of that month just building context and deciding how not to break everything. A team familiar with the codebase is even more valuable doing product work, bug fixes, and review of the existing codebase. So, in short, I do agree with the simple fact that this is still too expensive for most projects, but not with the idea that “a small team would trivially do better in a month”.
- Buttons840 2mo agoI've always felt [0] the people who created Bun had, as their first and foremost goal, a desire to use Zig--and that's great, I like Zig, I like when people build things their own way. However, I've been skeptical of using Bun, because I want a project whose first and foremost goal is to build good tools that achieve the objectives of the project. It reminds me of asking game developers: Do you want to build a game, or do you want to build a game engine? Building a game engine is fine, but if you're goal is to make a game, then building an engine is a poor way of achieving your goals. Likewise, I've wondered if the creators of Bun wanted to build better JavaScript tools, or if they wanted to use Zig. [0]: https://news.ycombinator.com/item?id=35970044 https://news.ycombinator.com/item?id=35970044
- ameliaquining 2mo agoSo does that mean the rewrite made you less skeptical?
- Buttons840 2mo agoYeah, I guess. Now it appears to be a project run by Anthropic and I'm sure the real focus is on making money--which is still slightly different than having the focus be on making the best tool.
- crote 2mo ago"Make more money" in this case could also be "do high-profile rewrite for marketing reasons, silently abandon a year later".
- MrCheeze 2mo agoI mean, surely the main motivation for "use an LLM to rewrite a huge project in a new language" was excitement about the shiny new tech that made it possible.
- didibus 2mo agoArticle did a decent job of showing discipline and care and human involvement to assert the automated rewrite was done diligently, as best as it can be when using AI for it. I does make me feel a bit more comfortable about it. As an aside, I don't know why anyone would not want to use a memory-safe (and possibly race-safe) language in 2026. Rust gives you that in a performant package, so if you are turned off by GCs and immutability for performance reasons, you still have the option to use Rust. I can understand when you need the absolute best performance and you decide to drop to down to C++, and I also relate with just personal preference, but beyond those it seems a no brainer to me.
- leecommamichael 2mo ago> As an aside, I don't know why anyone would not want to use a memory-safe (and possibly race-safe) language in 2026. The rust compiler is very slow. The best way to speed it up appears to be organizing a codebase in many crates. This is not preferable ergonomics to many. Beside that, for many problems, a garbage collector eliminates a large amount of defects (including the ones stated in the article) without any added friction, whereas Rust asks that you think in terms of ownership. This is not preferable ergonomics to many. I realize what I'm saying above, while true, doesn't give a clear example. Many gamedevs would rather iterate with a language that is lower friction, not only because game code is finnicky (like frontend UI code) but because the build process can be unique. Many gamedevs prefer to iterate with hot-reloading, and asking them to use a slower compiler is asking them to accept greater latency in that cycle. I do not claim that these reasons apply to everyone.
- gpm 2mo agoThe comment you're replying to wasn't arguing rust > GCed languages (e.g. C# or whatever game dev language you are thinking of). It was arguing rust > non-GC non-safe languages (e.g. zig).
- leecommamichael 2mo agoI see that now, thanks. There's a lot to say here, especially with other approaches to memory management. My overall goal was to give them some context that wasn't their own.
- incognito124 2mo ago> In Bun v1.3.14, every build leaks about 3 MB, forever I'm sorry but that is insane, how was this never fixed before the rewrite?
- pier25 2mo agoI've been impacted by a couple of bugs in Bun.SQL and lo and behold these were only fixed for 1.4. Presumably Claude could have fixed those in the Zig version but the Bun team decided to not do that. Furthermore, there's no mention of an LTS plan for the Zig version. It seems that if a CVE is discovered in the future, Bun users will no have no option than to update to the Rust port. This is not how you run a project that others depend on and enough for me to not touch Bun ever again.
- dgacmu 2mo agoI'm a little puzzled: Why should you care? The language in which Bun is written isn't part of its API, if you will. You care that you have something that does various javascripty things according to a particular spec of what it's supposed to do. If a bug is fixed in 1.4.x it's fixed, why should it matter, really, if that's in Zig or Rust?
- pier25 2mo agoWho in their right mind would immediately migrate their production apps into a complete re-write of a runtime? It would be naive to think there aren't new bugs or changes in behavior introduced in 1.4.
- dgacmu 2mo ago(Well, the answer is "Anthropic, with claude code", but I'm not in possession of material information related to whether they are or are not in their right minds.) But yes, of course there will be new bugs. But that's why 1.4.x for x > 0 is interesting. If the branch is being used and people are not reporting _more_ bugs, and the bugs you care about it are being fixed (successfully) on it, and it passes your tests, etc., ... I dunno. This is an application domain where you can do some pretty solid testing of it, comparative fuzzing, etc., so it doesn't strike me as entirely mad to jump over after a few minor releases where you can see the bug trajectory.
- nzoschke 2mo ago> Historically, rewrites are a terrible idea. This changed for me over the last 5 years. The first scenario was joining a company where a software product barely worked. We did the traditional incremental refactoring / rewriting, but eventually learned how rotten the core was that rewriting from first principles was the best path forward. The lesson learned here is that the conventional wisdom probably only applies to rewriting complex but working systems. Then multiple scenarios in the agentic coding age. Between day jobs and hobbies I've reproduced major chunks of complicated software like Salesforce, Gmail, Pioneer Rekordbox with very lean teams. Much like the blog post, the trick is to get an excellent verification loop with a compiler, linter, and test harness / test suite around the core behaviors. It's feeling more and more that designing and implementing comprehensive test harnesses is the real work, once you have that let the LLM cook.
- yomismoaqui 2mo agoI think the same, it's possible our job will morph into "coding agent herders". In this case I guess the test harnesses, linters, workflows, etc will be our herding dogs.
- frollogaston 2mo ago"I used a pre-release version of Claude Fable 5 for much of the Rust rewrite." It'd be interesting if Anthropic became a general software company just because they have access to models that aren't yet released, possibly export-banned.
- dabinat 2mo ago> This Rust rewrite would've taken a team of engineers with full-context on the codebase a year of work. With 1 engineer using Fable & closely monitoring Claude Code, we went from start to 100% of the test suite passing on all platforms in 11 days. This is impressive from a technological standpoint, but it does gloss over the fact that it would have cost $165k in tokens were Bun not part of Anthropic. The comparison here isn’t completely fair - it would take a small team a year to port it if they spent $0 extra on it. I’d be interested to see a comparison between spending $165k in 11 days on Claude vs splitting that between 50 people over 11 days for a line-by-line rewrite of the Zig code. I suspect Claude might be faster and therefore cheaper, but maybe not by a lot.
- Philpax 2mo agoI think it'd take you at least eleven days to meaningfully coordinate 50 people!
- tekacs 2mo agoI feel like a core difference is that the AI implementor can get cheaper/faster (and indeed _uniformly_ better), whereas it would be very difficult for the same humans to do so. Even if this is not the right answer today, it can at the very least serve as a herald of a possible future, no?
- Jenk 2mo ago$165k won't get you far on salaried engineers. There's every chance that 1 engineer, assuming Anthropic employs them, is on $500k or more. Assuming average of $336k in that pool of 50 engineers, then for 11 days for 50 engineers you've spent $710k[0]. Salary info: https://www.levels.fyi/companies/anthropic/salaries/software-engineer?country=254 https://www.levels.fyi/companies/anthropic/salaries/software... [0]The maths I used (posting because I'm tired and prone to mistakes): $336,000 / 260 (working days of the year) = ~$1,292. $1,292 * 11 * 50 = ~$710,769
- bhaak 2mo agoYou don't need top engineers to port a program from one language to the other. Outsource it to India. Of course, then you can also ask, could it have been done with a cheaper model. Probably yes. But then you wouldn't get free marketing.
- achristmascarl 2mo agoI was fairly skeptical about the rewrite when news about it first started going around, and I still don't plan on switching anything to use the Bun rewrite anytime soon, but I appreciate how detailed and well-written the blog post is; it also seems to be primarily human-authored, in my opinion, which is refreshing. The most significant revelation for me was that Claude Code has been using the rewrite without much fanfare since June 17th.
- DobarDabar 2mo ago[dead]
- sashank_1509 2mo agoI think the important thing is this is much cheaper than hiring a software engineering team. They could have hired me for 200k and I could not do this in a year. I do not have the context, and I do not know Zig or Rust, perhaps I could pick it up in a month, but I would be extremely slow. Forgetting all the predictions about singularity etc, at the very least AI as it is now, is going to make it very hard to justify hiring a SWE for 200k. I will say, at the very top for a software heavy company like Google or Anthropic, they will still hire excellent engineers to create new software that AI is not very good at. But for companies where software is simply a cost center. Like Walmart, or Target, companies that were already outsourcing software development, or using cheap H1bs, now they have the alternative of AI which is much better than even hiring an average software engineer for 200k. This is a sea change in the job market, it’s going to have a pretty big effect as it is right now. US has around 1.6 Million software developers, this number is going to get cut drastically, the very top, say an L6 quality in FAANG will be fine, the average in a no name Bank, or the guy building the website for McDonalds is out, he needs to learn something else or he’ll end up without a job soon. I would not have predicted this a year ago, now it seems clear that this will happen. Just shows how much of a sea change we have witnessed just like that.
- jameskraus 2mo agoIt's funny, I see the opposite and I would only trust a senior engineer with conducting such a wide-reaching change. I would be more likely to hire a senior engineer who might now be able to effect such change.
- metalspot 2mo agoExactly. AI opens up a massive development frontier of projects that were simply impossible before. It does differentiate though. In the old world most "software engineering" work had nothing to do with software engineering so being highly skilled, educated, and experienced in software engineering made very little difference in compensation, position, promotion, etc. "software engineer" isn't a real thing anyway. coding is a secretarial job. you have to move beyond the mindset that coding is doing something useful. it's not. it is a means to an end and now better means exist. if you want to be an engineer you have to think in terms of systems engineering and building systems that deliver defined externally testable capabilities. in a few more years the idea of reading and writing source code will seem as absurd as reading and writing asm seems today.
- Barrin92 2mo agothe thing I don't understand about this, given that the goal was a line-by-line transpilation, and the author had already transpiled it once from Go to Zig, why not write an actual transpiler? A problem is as complex as the smallest program required to solve it, and having an LLM, which doesn't produce deterministic output churn through almost 200 grand when you only need to write a deterministic program maybe 5% of that size seems like not a great way to go about this
- crote 2mo agoBecause the author isn't employed by a transpiler company. The entire point is to get people to spend money on LLMs. Writing a transpiler - even a LLM-coded one - pretty much defeats the purpose.
- pohl 2mo agoThis is a frequently mentioned criticism. Is there a good argument about why that approach could have been done in the same amount of time? Seems like larger scope and more uncertainty to me.
- Barrin92 2mo ago>Is there a good argument about why that approach could have been done in the same amount of time? as I said because it's a much smaller codebase. This is a million lines of code project. A literal Zig to Rust translation that is mostly syntactic is not going to be more than 10-20k LOC for a transpiler. That's two orders of magnitude less work.
- deleted 2mo ago[deleted]
- suby 2mo agoI'm so jaded at this point. The AI translation from Bun to Rust doesn't bother me, I think it's interesting, but that this blog was so clearly written by LLM's is offputting for some reason. I think after having to interact with LLM's for much of the day, it's exhausting to read LLM speak in so many things I see online. It feels almost disrespectful to the reader. It's written from a first person perspective, but Jarred did not write these words. I was looking forward to this blog post too, but in retrospect I don't know why. I could have had an LLM generate a hypothetical of what this blog post might have looked like and it would have probably been able to get close. I feel like we've replaced unique voices on the internet with the same style / author, which might be more tolerable if the breathless LLM writing style wasn't so jarring. Contrary to the amount of times "But honestly" or "genuinely" is mentioned, nothing about having your LLM speak for you feels honest or genuine. I know it's not cool to leave responses like this, but I'm really tired of all of this at this point. The ironic thing too is that it might actually be better to have LLM written text be so distinct so that you can still pick out when a human has actually authored something. Again, this is a blog post from Anthropic about having an AI translate 500k+ lines of code in 11 days, so I guess my disappointment is my fault for expecting otherwise.
- jsnell 2mo ago> that this blog was so clearly written by LLM's is offputting for some reason It doesn't read at all AI-generated to me. What section do you think is? (Pangram is very good at distinguishing between AI-generated and human text, and assigns a very low score to the article: https://www.salahadawi.com/hacker-news-ai-detector/rewriting-bun-in-rust https://www.salahadawi.com/hacker-news-ai-detector/rewriting...) > Contrary to the amount of times "But honestly" or "genuinely" is mentioned, nothing about having your LLM speak for you feels honest or genuine. "Honestly" is used once in that post, in a way that's pretty much the core, self-deprecating human use for it ("It would have been possible to do X, but honestly I didn't want to"), rather than the filler word use-case. "Genuinely" is not used at all. > I know it's not cool to leave responses like this, but I'm really tired of all of this at this point. I think it is cool to flag AI-generated slop and either leave a comment or upvote an existing comment about it being slop. But only if you are sure it's AI-generated. And sorry to say, you don't seem very well calibrated on this. If you can't actually tell the difference and back up your opinion but are just guessing, then it indeed isn't cool.
- pier25 2mo agoPersonally I don't care that they used AI to rewrite Bun to Rust. Even if 1.4 is not good enough it will probably get better over time. What has pushed me back to Node is seeing how amateurish the transition has been handled. - No LTS support for the Zig version regarding CVEs etc. - Huge bugs like the 3MB memory leak mentioned in the blog post abandoned in the Zig version to basically force people into the Rust version to fix their apps in production. - Zero involvement with the Bun community about such a major decision. One day it was "stop the drama I'm just playing with this" and a couple of days later "yolo merged to main". Jarred basically keeps operating as if he was a lone hacker working on his personal project.
- iknowstuff 2mo ago1.4 has no breaking changes from 1.3 so why would there be an LTS and any guarantees for people staying on 1.3? All known regressions have been fixed like any other release as far as I can tell
- deleted 2mo ago[deleted]
- alexjurkiewicz 2mo agoPaying customers get LTS. Are any paying customers asking for a Zig branch LTS? Or are you expecting open source maintainers to do free work for no particular reason?
- pier25 2mo agoJava, Node, and .NET have LTS versions all of which are free to use. > Or are you expecting open source maintainers to do free work for no particular reason? Free work? Last I heard Anthropic had acquired Bun.
- Tadpole9181 2mo agoAre you asking for an LTS Zig version as a member of Anthropic?
- 2mo ago
- anonyonoor 2mo agoI think we're finally getting to see a glimpse of the future. People and LLMs, working together. (And doing it really well.) It's pretty exciting.
- surround 2mo agoIt seems that Deno made the right decision by choosing Rust from the get-go.
- erk__ 2mo agoDeno started in Go, but was rewritten in Rust before 0.1
- losvedir 2mo agoIn what ways does Anthropic use Bun? I know it's used as the "runtime" for Claude Code, but rather than porting a million lines of Zig to Rust, why not just port Claude Code to rust and not need to bundle a JS runtime at all? Does Anthropic use Bun otherwise? Maybe for JS execution tool calls in Claude responses?
- atonse 2mo agoI’ve wondered the same. Especially because codex is written in rust. Why not just port Claude code over. But my guess is that maybe it doesn’t have as robust a test suite? This might embolden them to do it…
- KronisLV 2mo ago> But my guess is that maybe it doesn’t have as robust a test suite? Not sure about what's going on over there, but over the last year Claude Code has gotten way better, I sure hope that they're working on a good enough test suite to avoid a crapload of regressions (and pave way for more refactoring, should they need it).
- atonse 2mo agoThings improved tremendously the first month after they acquired Bun. People like Jared (bun creator) worked relentlessly on the performance bottlenecks, and posted details on X as he worked through them. I remember just launching claude code used to take multiple seconds, and within a month it went down to instant.
- rane 2mo agoIt's extremely difficult to have a robust test suite for a TUI app like Claude Code. Hence regressions keep showing up in every update.
- deleted 2mo ago[deleted]
- ares623 2mo agoWhat does it say that it took 2 months to write the blog post? (or at least have it published)
- tln 2mo agoThat a human wrote it?
- cube00 2mo agoHe's been teasing this blog post everywhere (in commit messages, multiple times on X, here on NH [1]) so I wonder how much of it was building hype compared with it legitimately taking two months to write. I wonder if the delay of Fable has also been a factor and maybe they didn't want to release this blog post while they couldn't allow customers to use Fable and waste the advertising opportunity. [1]: https://news.ycombinator.com/item?id=48133519 https://news.ycombinator.com/item?id=48133519
- rifty 2mo agoSuper interesting! I feel like people will make the wrong comparison with the cost to complete. $165000 should be compared to not the cost of a programmer going line by line by hand but someone designing a transpiler from zig to rust. The time to complete is impressive though, if you could spend $165000 and a year of time to find out the rewrite project worked, or instead spend that in a month, you'd probably take that month now that this proof of concept exists out there.
- quux0r 2mo agoSomething that seems to have flown under the radar is that bun was originally a rewrite of Evan Wallace’s work (for those that don’t know, he’s a co founder of figma). What I’d love to know is if Evan’s implementation is largely independent and, if so, says a lot about his skill (even more so than the rest of his impressive catalog) to have a reference-able implementation for what it turned into. Super cool to learn the original implementation motivation for Jarred though.
- WhyNotHugo 2mo ago> around $165,000 at API pricing This is the bit I was really curious about. Definitely not something within reach for us mortals.
- zamadatix 2mo agoOn the bright side, that price would continue to drop rapidly even if the models themselves never improved anymore. I'd be very surprised if we didn't actually end up with ~100x cost reduction of this task in the next 10 years between hardware improvements, model perf/$ improvements, and commoditization/conpetition. For now though it is a bit disappointing trying something like this is relegated to project proposals at work rather than my personal hacking.
- smasher164 2mo agoIt's still shocking to me that the approach taken wasn't to have Claude write a tool that translates Zig to Rust. I imagine it would've been cheaper, deterministic, and each iteration would produce a better tool.
- PierceJoy 2mo agoThis seems like a much much harder problem than having a model translate between the two languages. I think people in general are way overvaluing determinism. In most cases, it doesn’t matter if the output from two runs is different as long as it accomplishes the desired goal.
- shimman 2mo agoNever thought of cross language code mods to be a thing but surely there are libraries out there that deal with the interop of different ASTs across languages? Seems like an interesting area of research.
- erichocean 2mo agoThat's the approach I've taken with a bunch of legacy OpenCL code I've mechnically translated to Metal, worked great.
- m00dy 2mo agoRust is the clear winner of LLM era. You can't say otherwise.
- grandimam 2mo agoThe rewrite itself is amazing, but I don't think folks realise the actual conditions that made it possible. It's not as simple as a company spending ~$160K on tokens. This was done by someone who has essentially already rewritten Node once. Bun itself is a reimplementation of Node, so the author was walking in knowing exactly what the correct behavior is. And an exhaustive amount of test suite to verifiy the changes?. On top of that, there is a reference from Node and V8 to validate more throughly. So the $160K is simply the price of translating knowledge that already lived in one engineer's head in a newer syntax.
- hresvelgr 2mo agoThe condition that made this possible is that this task is well within frontier LLM capability and he had tokens to burn. Domain knowledge is separate to language semantics.
- jatins 2mo agoExtremely thorough and well written. I was hoping it’d end in a “so how much did this cost?” so that others team looking at similar migrations have an estimate on what they can expect
- deleted 2mo ago[deleted]
- marcianx 2mo agoIt's right there under "Stats": > 11 days (May 3 → merged May 14) · 6,778 commits > Pre-merge, this took 5.9 billion uncached input tokens, 690 million output tokens, and 72 billion cached input token reads — around $165,000 at API pricing. By hand, I think this would've taken 3 engineers with full context on the codebase about a year, during which time we wouldn't be able to improve Node.js compatibility, fix bugs, fix security issues or implement new features. We never would've done that. The realistic alternative was to do nothing and keep fixing the bugs at the top of this post forever.
- hdjrudni 2mo ago> I was hoping it’d end in a “so how much did this cost?” so that others team looking at similar migrations have an estimate on what they can expect It was in the middle. $165k.
- DennisL123 2mo agoIn a world without AI/LLMs/agents the rewrite would have been major news how much better software gets when ported to Rust.
- lionkor 2mo ago> C++ instead of Zig would be a reasonable choice for Bun. We would get constructors & destructors. We could delete lots of extern "C" wrapper code. > But, we would still be reliant on style guides enforced through code review, and even with ASAN, memory corruption and memory leaks would still happen. Tell me you didn't even look at C++ without telling me you didn't even look at C++. I don't understand this at all, what's missing? There's clang-format, clang-tidy, cppcheck and so many others, what is missing exactly? Memory safety? Then why bring up C++ and style guides(?) at all?
- kubb 2mo agoNot replying directly to OP, just to people who never coded in C++. Clang-format doesn’t save you from all C++ footguns, e.g. using exceptions, macros or templates in the wrong way where „wrong“ is defined by a fuzzy set of rules that requires a lot of experience and vigilance to enforce.
- jordand 2mo agoThe thing you have to remember with that $165k spend on tokens is that token prices are going to keep rising, and models may not get much better. I wouldn't be surprised if doing this same migration in 6 months time would end up costing $250k+
- capiki 2mo agodo you think price per task completed will rise as well?
- hdjrudni 2mo agoIsn't that equivalent? The task here was port Bun from Zig to Rust. He's saying that task will cost more.
- cognitiveinline 2mo agoThat's not the direction of LLM progress these past 2 years. Cost has always decreased per unit intelligence. Open weight models with lower parameters beat gpt4 that we were so impressed by.
- Havoc 2mo agoFor sota perhaps but not convinced token price will shoot up if capability is held steady
- Avrio15272 2mo ago[dead]
- voidUpdate 2mo agoI wonder how much the authors now understand their project? Like, if they were given a bug, would they be able to intuit a possible location in their files that might be causing it? Or are they now essentially locked in to using LLMs to write/rewrite their code?
- egorfine 2mo ago> how much the authors now understand their project I don't think this is a value anymore for them.
- deleted 2mo ago[deleted]
- tomkarho 2mo agoThe way this trend is going we might need "rewritten in Rust" catalog similar to Google's graveyard.
- khurs 2mo ago> Bun was acquired by Anthropic in December 2025 Great for the Bun creators, but now we will have major runtimes that are optimised to work with one companies models...
- joygqz 2mo ago[dead]
- matklad 2mo agoTo add more context around lifetime errors and TigerBeetle's particular style guide: >Many projects opt to answer these kinds of questions through a style guide. TigerBeetle's TigerStyle is an example in Zig and Google's 31,000 word C++ style guide is another. The challenge with style guides is enforcement. TigerStyle[1] is a bit more than just a style guide. The key rule for this discussion, uplifted straight from of NASA[2], is *static memory allocation*: all memory is allocated in the startup phase, and there's absolutely zero `alloc`s afterwrads . This plus crash only[3] design means that we never call `free`. This rule is self-enforcing and compositional, in Zig. There's no global memory allocator, so the code after startup simply hasn't the API to allocate. You can't circumvent this by accident. Of course, if the programmer is byzantine, they can stuff allocator in the global, or just directly `mmap` and `unmap` pages of memory, but, at our scale, we don't have problems with that. This is a similar in kind (not degree) to Rust, where untrusted code generally can circumvent safety guarantees, even without literally spelling `unsafe`. And, naturally, never `free`ing goes a long way towards solving many memory errors by construction. Empirically, they just haven't been a problem for TigerBeetle. It's hard to untangle contribution of static allocation in particular from everything else we are doing, but it would make sense for it to play a leading role. (As a footnote, we aren't actually do static allocation to avoid memory errors, we use it as a linter to check that every quantity has a known _logical_ static limit, the main property we care about) [1]: https://github.com/tigerbeetle/tigerbeetle/blob/main/docs/TIGER_STYLE.md https://github.com/tigerbeetle/tigerbeetle/blob/main/docs/TI... [2]: https://spinroot.com/gerard/pdf/P10.pdf https://spinroot.com/gerard/pdf/P10.pdf [3]: https://www.usenix.org/legacy/events/hotos03/tech/full_papers/candea/candea_html/index.html https://www.usenix.org/legacy/events/hotos03/tech/full_paper...
- jrpelkonen 2mo agoBy all accounts, TigerBeetle has been a tremendous success, congratulations! My understanding is that it has a deliberately fixed scope, which makes me wonder: how applicable would TigerStyle be in more general-purpose applications? If the system needs to, say, ingest arbitrary JSON documents ranging from 100 bytes to 100 GB, how would TigerStyle fare?
- 2mo ago
- vrtcn 2mo agoI am a bit suspicious about the choice of startup time as the metric to evaluate performance in Claude Code. With a rewrite from a language like Zig to Rust, my biggest performance concern would be allocation. Where a Zig app might use a fast linear or buddy allocator, a Rust app is more likely to use malloc. During startup, both versions are likely to make tons of allocations. In fact, the Zig version is likely to make larger allocations during startup to reserve memory for its custom allocators. So I would expect both versions to be roughly on par, or Zig slightly worse there. However, during normal execution, I would expect the Zig version to be potentially faster, because it has paid the cost of malloc at startup and now an allocation might be as fast as incrementing an integer. This is speculation, but I would like to see performance numbers for the rest of the app lifecycle.
- anentropic 2mo agoThose were in the article https://bun.com/blog/bun-in-rust#2-5-faster https://bun.com/blog/bun-in-rust#2-5-faster
- egorfine 2mo agoTo me this whole saga stands on a very thin overlapping region between "it has merit" and "I hate it". Like, the blog post clearly explains the merits and they are strong. At the same time, I absolutely hate how the author handled the whole rewrite, including throwing the whole community out the window along with all their contributions and human love.
- egorfine 2mo agoAny chance for 1.3.15 with top bugfixes for those of us who once trusted Bun and are stuck on it in production? I have migrated almost everything out of Bun by this point but I have one single project that builds into executables with Bun and relies heavily on Bun's SQLite.
- grougnax 2mo ago[dead]
- waysa 2mo agoI tried Bun for a weekend around Christmas 2024. I quickly hit a bug that would freeze the runtime (issue #13237) when piping a stream into a file. I found that this had been open since August 2024, scrapped the experiment and moved on. The issue is open to this day. If the GitHub comments can be trusted, this behavior even carries over to the Rust port.
- jdw64 2mo ago[dead]
- awson 2mo agoI just glanced at it, but in "Rust supports cross-language link-time optimization between C/C++ and Rust" it's not Rust but LLVM. Any languages with LLVM backends get cross-language LTO for free. Have they ever tried Zig Bun with LTO?
- dwdz 2mo ago"The blog post is expertly written. It's almost like the marketing department of a trillion dollar company has a lot of money riding on this article." -- Andrew Kelley https://andrewkelley.me/post/my-thoughts-bun-rust-rewrite.html https://andrewkelley.me/post/my-thoughts-bun-rust-rewrite.ht...
- jjice 2mo agoWithout accusing anyone of anything, I do think that this coming from the head of Zig, who gets a lot of negative publicity from the Bun rewrite (unjustifiably, it's a wonderful language) makes it harder for me to take this without wondering if there's some animosity that's really the main complaint. > Two, I actually don't have any personal criticisms of Jarred The author says two things that really popped out to me that you could say are "professional" and not "personal" criticisms, but I think they're still rude and contrast this statement. > Jarred was already writing slop well before he had access to LLMs > The grapevine was large and healthy and full of juicy grapes, and all those grapes contained the juice of the same message: Jarred was a stinky manager. Poor communication, unrealistic expectations, low empathy, no experience Now, both of these may be true. I don't have any evidence though, so I don't know how to take it. All this to say, I'll take both of these posts without a ton of salt when it comes to the non-technical parts.
- xyzsparetimexyz 2mo ago> I asked Claude to loop the workflow on all 1,448 .zig files, and about 2 minutes in, one Claude ran git stash before committing. Another ran git stash pop. And then git reset HEAD --hard. They were stepping on each other! I hate how easy git makes it for llms to catastrophically fuck up repos > And if I put each Claude into a separate worktree, I would run out of disk space because Bun's git repository is too big and eventually the changes will need to be compiled and seen together. This seems like a stupidly easy problem to fix. > So, I asked Claude to edit the workflow to instruct Claude to never run git stash or git reset or any git command that doesn't commit a specific file at once. No cargo either. No slow commands at all. What's the right way to fix this? I have a Pi extension that blocks any use of the word 'git' with 'stash/checkout/reset/restore' in commands which is a very large hammer approach. Is there a way I can allow a subset of git use in a nicer way without the less nice commands?
- rockmeamedee 2mo agoFor Bun to not have torched its reputation among its users, it would have had to publish this blog post _before_ pressing merge on that PR. That's what underlies most of the vitriolic reaction to the events, it was done really in a really rash way. All they had to do was a)not gaslight people about your intentions when they found the branch b)publicly post the intent to do this, and then c)publish a doc like this one right before merging, ideally leaving the branch open for like a week in case anyone in the "community" finds things to fix. Then those UB/Miri issues others found would have been "yay collaboration" boosts instead of negative issues that prove that the approach was risky/unthoughtful. If you're going to cross a rubicon, maybe tell people a)that you actually want to do it, b)why you want to do it and c)what it looks like after you've done the rewrite.
- elktown 2mo agoIt's depressing seeing so little critical thinking despite clear and obvious incentives (Bun now being part of Anthropic) behind the reckless decisions that's been made here. Judging by this thread a well-formed article is all that's required for lots of people to just take everything at face value since it confirms the biases of what's currently fashionable.
- pohl 2mo agoWhat specific critical thought(s) do you wish were voiced?
- elktown 2mo agoThat this is a technological decision rather than rationalizations (e.g. fixing self-inflicted problems are now marketed as a rewrite win) that Rust is a better fit for an Anthropic-owned project.
- perching_aix 2mo agoIndeed as the developers behind Bun, it would be rather difficult for them to not be the originators of the bugs that they have now fixed with this. Why is your unsupported speculation about the guy (or the people above him) supposedly deciding that "Rust being a better fit for an Anthrophic-owned project" a critical insight exactly? You not being convinced by the rationale presented does not mean he himself wasn't. Do you imagine critical thinking as just coming up with and preferring (to you) plausible-sounding alternative explanations? Because respectfully, that's very much not how I understand the word, and I'd hope most people do not either. Maybe that's the issue. Post-hoc rationalization being a rather shaky gate with people (and AI) anyways. Worse still, neither of the options you present are trustworthy summaries necessarily in the first place. From the blogpost: > What if, instead, I spend a week testing if Anthropic's new model can rewrite Bun in Rust? That sounds to me like something of an excited but cautious dare, not an arbitrary technological decision, nor some hyper-strictly rationale-supported one. It's the same kind of exploratory excitement anyone who used these things at all would be familiar with: you have an unlikely project idea, with some contentious details that are fair (see their blogpost), and some that would be simply annoying to justify (see your comment). Buuuut you also have heaps of corpo money, a lingering suspicion and interest, and AI tokens to burn. And so "fuck it, we ball". Not much to believe on it when it's a shared experience. And it's not because of just having read so somewhere, despite your assertions otherwise.
- zamadatix 2mo agoAn extremely interesting blog post for me on a few fronts: I'm very glad to see a holidtic approach to the memory errors and segfaults. I was tinkering on a static webpage just this this weekend, using Bun as the transpiler+bundler since it's so turnkey, and I ran into a few segfaults. E.g. when Bun saw I used an empty data uri for the favicon (avoids the browser trying to ask for one) it'd just crash. It reminded me of my own tinkering with Zig in its current pre-release state where it's usually a good mix of my poor memory management and working around bugs in Zig itself. This post is also the best ad for AI I've seen yet. Not just comments saying they have 10xed themselves, a small personal project or thing which can (and likely will) be abandoned next month, or a one off dump of unusable code for the world's buggiest C compiler (come on Anthropic?). Instead this is a well thought out way of leveraging LLMs to do something which would otherwise probably not be deemed a reasonable enough effort. I'm glad they included the rough cost as well. Crazy high, more than I can afford to be throwing at the wall to see what sticks, but still low enough to make sense over trying to hire developers for (even ignoring the timeline). But it also highlights 2 really key things about current LLMs: the scaffolding can be just as valuable as the model & they still need someone able to figure out the right way to instruct and orchestrate them. Without the scaffolding the current models could never get close to handling something of this scale & quality. With the scaffolding you could probably get this to work okay enough even with a weaker model. On the orchestration side, Claude could help answer what good porting practices would be but it doesn't just get there itself, it requires hours of someone who understands the context of the project from bottom up and a clear understanding of what will/won't work to get the right scaffolding to do the job well. Finally, it was an interesting dichotomy on presenting the port. On one hand it has been a bit opaque up until now. People saw the repo and there were some comments about testing the waters but then it suddenly shipped into production. On one hand that's awesome and I'm sure the reception here would be very different if there wasn't the "it's already been boringly shipped in Claude Code" shining result. On the other... I think I'll stick to using Bun as a personal tinkering tool for now. The velocity is so high I'm just not sure it'll land in a place I can rely on it st the speed of my org. Of course, that velocity is what has made Bun's success story and they should probably continue with it - I'm just looking forward to an LTS release :).
- rwlank 2mo ago[dead]
- emilfihlman 2mo agoUntil this bug is fixed, there's no trusting Bun This is also not a memory issue but an actual logic issue, so Rust doesn't help there. https://github.com/oven-sh/bun/issues/14144 https://github.com/oven-sh/bun/issues/14144
- QuadmasterXLII 2mo agoPutting on my machine learning PhD student hat, the way to do this was to leave 10% of the tests out as a ‘test’ set and then once the port was done, bring them back in and find out how good the port is. The port may genuinely be good but because they spent 100k of compute hill climbing the whole test suite, “the test suite passes” now provides far less evidence that the port is good. Its weird that at Anthropic, a very ML phd company, no one pointed this out.
- StriverGuy 2mo agoHuh? This approach makes sense for non-deterministic problems. Not engineering problems that have deterministic end results.
- QuadmasterXLII 2mo agoI’d want to estimate P(a random test passes) where the existing suite of tests is taken to be sampled from a distribution.
- geraneum 2mo ago> non-deterministic problems I'm guessing you mean probabilistic? Nevertheless, you have an indeterministic variable here which is what the LLM generates.
- padjo 2mo agoIt's very odd how quickly people fall back on emotional claims to attack this. Like we're engineers, if you can point at concrete problems with this rewrite I'd love to hear them. Obviously Jared is going to give the positive case, saying that he's doing that doesn't prove the rewrite is a bad idea. You need to point at objective problems, not your vague sense of unease. As it stands, by all available measures, this appears to have been a massive success, which is absolutely remarkable.
- afry1 2mo agoTechnology does not exist in a vacuum, nor does anything that is engineered. It's not this abstract stuff detached from the world. PEOPLE make stuff, people use stuff, and people are ultimately the ones who are going to pick and choose which stuff gets made, used, adapted, enhanced, and carried into the future. AI is an inherently anti-social, anti-human technology, and this rewrite is the perfect example of that. Assessed from the perspective of "technology in a vacuum", of course. it's a success. He did the thing that transformed the thing from one kind of stuff to another kind of stuff. It still does all the things it did before, and in many cases with better stats than it did before. Assessed from the human angle, and especially the angle of Bun as a community, I would bet money that this rewrite -- executed by nobody for nobody, built and maintained by machines, maintainable only by machines -- has killed the entire project. Maintainable only by machines, because anybody with any knowledge, experience, or investment into Bun as a platform, or who contributed patches themselves, or whoever had a question about how it works and went "Hmm, I'm gonna go into the codebase and take a look at how that happens", they all got slapped in the face and summarily kicked out of the tent with the rewrite.
- Ygg2 2mo ago> AI is an inherently anti-social, anti-human technology, and this rewrite is the perfect example of that. Not really. LLMs are a tool, and they do possess some interesting properties, but they are, in essence, a very surprising auto-complete. No, what sucks is the AI companies marketing them as if they are The Holy Grail. And people are assuming that somehow LLM -> AGI -> ASI, even though there isn't really a causal link to be had, and acting like it's The Singularity. I don't blame autocomplete for fucking up RAM, labor and god knows what else. I blame the idiots (at OpenAI and Anthropic) buying all RAM stocks and pretending this shit is any way good for anyone.
- mghackerlady 2mo agoThis makes me sad :( I've always really liked Zig, and Bun was pretty much the only big thing I could point at and say "that was done in Zig"
- erichocean 2mo agoTigerBeetle has you covered then.
- jmcqk6 2mo agoghostty is a zig project too!
- yoav 2mo agoElectrobun is still zig and doubling down on it
- pron 2mo agoSounds to me like his choice of Zig was made in haste, as was his choice of Rust. If you find yourself changing a project's primary language more than once a decade (more like 15 years, but let's say a decade), the problem isn't the language but your technical decision process, and that's what you should look into first. Some of the world's more important software - from browsers to the JVM - mix high-level languages with a GC and low-level languages, and it works not because of a style guide (even though one may exist). As someone working on the HotSpot JVM, I can say that it's done with a lot of thinking about constructing the right primitives that make this work well. Zig doesn't lack the features to construct the mechanisms required for getting good results in that domain, and Rust doesn't have features that could save you the thinking about such mechanisms.
- pron 2mo agoI should add that in the 30 years I've been a professional software developer, I've worked on and advised many projects. They all ran into serious challenges at one point or another. Not of those projects that was held in high technical regard changed their language (except for things like JS -> TS or when the project planned to change languages, starting with one suitable for prototyping and expecting to switch if and when their workload grew). All the ones that opted to switch language after less than a decade were those with serious shortcomings in their technical decision process, and those problems, unsurprisingly, persisted after the language change. After all, the very decision to switch so soon is an admittance that they'd made a very serious misjudgment, but these projects never properly debrief why they'd made such a big mistake and how they can avoid making one again.
- kanwisher 2mo agolikely you never were on a project that had tens of millions of users, you hit different classes of problems and you have to scale to new runtime or language often
- pron 2mo ago(BTW, when I wrote "Not one of those projects ... changed their language", I meant after less than a decade, as a continuation to the previous comment) First, technically respected products like the ones you describe either 1. plan or expect to switch in advance (e.g. they start with, say, Python/Ruby, expect that if they grow they'll switch to, say, Java) or 2. they improve their chosen language runtime (e.g. Facebook with PHP/Hack or Shopify with Ruby). Projects that switch a language without expecting to always show a pattern of bad decisions (clearly, if they thought their chosen language will carry them through growth and then they're convinced that it won't, that means that they don't know to judge languages' merits). Second, this is clearly not the situation here, is it? There is absolutely no new information that Bun learnt in the past year that they didn't have five years ago, and certainly this has nothing to do with growing workloads on some service. They say they believe the language they have chosen lacks the features needed for the very core of the domain, which is dealing with JS objects. As someone working on the HotSpot JVM, I can tell you this is not true, but fine - that's what they believe. What could have taken them five years to come to that conclusion? Again, this happens to be a domain close to my own, only much simpler, and I seriously doubt they made some novel discoveries in the past year. And if it's taken them five years to acknowledge what they now think are fundamental limitations with the language they had chosen, how can they be so confident they've made a right choice now after a few weeks? It looks like they chose Zig on a whim and then chose Rust on a whim, and neither of these choices is the source of their problems and neither is the solution to them.
- insanitybit 2mo agoThis is just a hit piece and it's embarrassing to post it on your project's website. Could've been a tweet.
- dzonga 2mo agouse Node or Deno. if you want superior developer experience - Deno. if you want stability over everything - Node.
- low_tech_punk 2mo ago(1) The original zig code was probably heavily AI coded with lower quality, hence the bag. There is a chance that a full rewrite in zig might do as well but we will never find out. (2) The rewrite itself is a massively successful marketing move. It shows what Claude code can do and how little it costs compared to human engineering. But the question remains whether someone else, not knowing zig, rust, and TypeScript can pull this off.
- tipiirai 2mo agoThis post was clearly an important marketing effort from Anthropic and Jarred. Those interactive demos alone would take serious effort from a seasoned frontend engineer, AI-assisted or not. Pretty sure multiple devs were working on this post.
- dirkc 2mo agoI got curious and had a look at some of the code (>1m .rs). I was surprised to see code for a S3 client in there? I clearly don't get the value proposition of bun? And even if I accept that you want to bundle your run time, package manager, test runner and bundler, why do you want to include things like a custom S3 client?