Earlier quoted context omitted.
Bun was not ported to Rust for performance reasons and its not clear to me how anyone can think it was. The reason they've given is memory safety.
Plus 1) There's much more reusable open source code written in Rust than in Zig 2) There are more Rust developers than Zig developers.
Claude Code uses Bun written in Rust now
731–740 of 920 posts
Re: Claude Code uses Bun written in Rust now
#732Re: Claude Code uses Bun written in Rust now
#733Earlier quoted context omitted.
Relevant passage from Jarred's post: "At the time of writing, about 4% of Bun's Rust code sits inside an unsafe block (~13,000 unsafe keywords across ~27,000 lines / ~780,000 lines), and 78% of those blocks are a single line — a pointer that came from C++, or one call into a C library. I expect this number to go down over time as we refactor from a faithful Zig port (which had no greppable unsafe keyword) to idiomati…
Relative "number of unsafe keywords" or "lines inside unsafe blocks" isn't a good metric. It's unsafe to call a C library that gives you a raw pointer, that can be a single line. It's unsafe to use that pointer, that could be a second single line. Carrying that pointer around, the data structures it's in, that's all safe, and doesn't implicate lifetime checking at all, so Rust will let you do silly things with the ac…
In short, if you use an unsafe block, then potentially any part of your code is unsafe.
Re: Claude Code uses Bun written in Rust now
#734Drilling into the original article where Jarred explained the reasoning behind the change, It's pretty clear that under zig the team was doing things by hand that are automatic in rust. Humans and agents share one thing: they are both non-deterministic. He talks about the issue of tracking memory lifecycles manually in zig so it can be explicitly freed. As expected, this leads to a long list of bugs where people miss…
I seem to recall this Rust rewrite is all "unsafe" meaning it really doesn't automatically eliminate those issues.
Re: Claude Code uses Bun written in Rust now
#735Earlier quoted context omitted.
> The "General Labor Substitute": He rejects the idea that his employment forecasts are "doom marketing". Instead, he asserts that AI will act as a general substitute for human labor, noting that most software engineering could be entirely automated within 1 to 2 years When someone says all Software engg could be automated within 1yr they don't mean 'oh use our agents and keep human in loop' They mean 'AI superior th…
News flash: most of software engineering is already automated. When was the last time you wrote code? They did not claim there is no human involved.
Re: Claude Code uses Bun written in Rust now
#736Earlier quoted context omitted.
Unsafe Rust doesn't automagically disable typesystem (& borrow checker, but lifetime are a sort of types). Once raw pointer is turned into a T, &T or &mut T, the borrow checker is on.
Borrow-checking the dereference of a stale pointer won't be worth much, though.
Re: Claude Code uses Bun written in Rust now
#737Earlier quoted context omitted.
They succeeded in spite of their tech choices. Their model outshone it, which is an extremely rare thing to happen and not something they could've counted on. In any other timeline they could've/would've been hurt by their choices. It's like "why did you go all in on buying scamcoin 3.0 as your investment strategy?" -- "I 5xed my money! End of story! It was fine!"
> They succeeded in spite of their tech choices. Or those choices just don't matter, it's fundamentally just "tabs vs spaces".
However, that's not the same as the technology choices not mattering at all. As others have mentioned the product is buggy, and it appears Anthropic are struggling to continue to release new features within the existing architecture.
That's also not to say that Anthropic made bad choices - there's always going to be a tension between building quickly to capture the market now vs moving slower and building something more maintainable in the long-term.
Re: Claude Code uses Bun written in Rust now
#738Earlier quoted context omitted.
Except that it hasn’t yet hit the real world, the live release is still 1.13.4, the last Zig version. Anthropic does not operate in the real world.
The canary build has been Rust for over a month, available to anyone. In that time it has been used in production for Claude Code and Prisma Compute.
Re: Claude Code uses Bun written in Rust now
#739Drilling into the original article where Jarred explained the reasoning behind the change, It's pretty clear that under zig the team was doing things by hand that are automatic in rust. Humans and agents share one thing: they are both non-deterministic. He talks about the issue of tracking memory lifecycles manually in zig so it can be explicitly freed. As expected, this leads to a long list of bugs where people miss…
Zig (like C) is simply not a good language to use if you're going to do many small allocations with uncorrelated lifetimes. To write robust Zig (or C) code, you must manage lifetimes yourself, for example by grouping allocations on an arena or by having fixed buffers of "things". You can just do that, and then Zig is really no less robust than Rust. But if you want to do "managed language" style allocation patterns (…
Re: Claude Code uses Bun written in Rust now
#740Earlier quoted context omitted.
Fun fact, unsafe does not let you turn off the borrow checker in Rust: https://steveklabnik.com/writing/you-can-t-turn-off-the-borr...
"Fun fact", it lets you largely circumvent the borrow checker by creating arbitrary lifetimes: https://news.ycombinator.com/item?id=48974824
“Safe rust isn’t expressive enough!” -> then use unsafe rust.
“Unsafe rust lets you do anything! Even crazy things!” -> then use safe rust. Or just don’t write crazy code?
Does bun actually do anything insane like that in its unsafe blocks? Or are you just fear mongering?