Live data from Hacker News

Claude Code uses Bun written in Rust now

simonwillison.net

211–220 of 920 posts

Re: Claude Code uses Bun written in Rust now

#211

Incidentally, Claude Code has been very buggy for me lately (much more so than before). Lots of TUI rendering issues causing, e.g., the conversation history to be garbled etc.

I'm far from being anti-AI, but these guys take it way too far IMO. It's straight-up AI slop. Like a real engineer still needs to be in the loop and drive the tool.

Anthropic seems to be all in on 100% AI code.

Re: Claude Code uses Bun written in Rust now

#212
Maybe I’m taking crazy pills, but I’m still stuck on “why the hell does a TUI need to run in terminal React by way of JavaScript”

The fact that Anthropic felt the need to buy a runtime so they could make their TUI better speaks more to the quality of engineering than anything else IMO.

If rewrites are so easy, why not rewrite CC in a native language? Would’ve been a hell of a lot cheaper.

Re: Claude Code uses Bun written in Rust now

#213
post #151

Earlier quoted context omitted.

grep -nr 'unsafe' . Is all you need to know to consider how much of an abomination it is

The original code was one giant unsafe block with almost no tangible way to find or debug all the subtle memory bugs and leaks they had. Now it's smaller, faster and has fewer bugs. Also its every potential memory issue is neatly annotated by an unsafe block so you can go and refactor them out one by one with confidence. All this seems like a pretty huge improvement to me. Why is this an abomination in your eyes?

> The original code was one giant unsafe block

True.

> has fewer bugs

Nope, this is demonstrably false because Rust has its own invariants around its types and the codebase is violating a lot of them.

> every potential memory issue is neatly annotated by an unsafe block

"Potential memory issue" can originate in unsafe blocks and safe code that are able to alternate the input condition of these unsafe blocks. Guess what? That still counts towards 100% in this code base, hence the abomination remark.

> refactor them out one by one

Not as easy as it sounds. They are like threads in a yarn ball, if there are one or two ends visible it's easier to sort them out. The actual situation is more like we have tens of thousands of ends (all the raw pointer code that comes with every shared object), to fix them it's basically a requirement to unwind the whole thing (rewrite all the callees and reorder the data flow as needed, redesigning all the APIs during that).

It's too early to declare it as anything remotely close to a win, optimistically saying.

Re: Claude Code uses Bun written in Rust now

#215

Earlier quoted context omitted.

11k in two years vs 5k in two weeks? You're right, numbers speak for themself.

Did Bun mass-close issues that predated the rewrite? It doesn't look like they did, as the oldest open issue is from 2021 and there are many from 2022, but maybe they did something that killed most of the old issues.

Their (public) project management is horrible, you can find fixed issues unclosed and unfixed issues closed. Not really surprising when that part of the work is completely taken over by LLM agents though.

Re: Claude Code uses Bun written in Rust now

#216
post #18

Earlier quoted context omitted.

It’s made absolutely no negative difference, as we’ve seen in the real world in the last 60 days since the merge. I feel weird having to defend reality; reality being that it was merged nearly 2 months ago and tons of people have had their pitchforks out without a shred of actual evidence that this made bun worse in any measurable way. But they still insist it was a mistake. I’ve never met Jared or the bun team but I…

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

#217

Earlier quoted context omitted.

Surely a lot of review has happened in the last two months?

Reviewing is meaningless while they are still keeping the 10433 (sorry it has become 10503 since last week) unsafe blocks, most unsound and none encapsulated. Any review would get to the simple conclusion that this should not be released before all the obvious bads are sorted out.

This feels like such an absurd, bad faith take I keep hearing.

In Zig, every single memory operation is unsafe.

And Bun must interface with C code that has no safe interface, necessitating a ton of boundary-level unsafe behaviors.

There's too much, sure, but can we at least be honest and reasonable?

Re: Claude Code uses Bun written in Rust now

#218

Earlier quoted context omitted.

Is the idea that a code base reset makes something stop being open source? Or that the number of people doing the reset matters? I don't see why either of those would be true. The project isn't dead just because it's in a different language now, and for liveness purposes it doesn't matter how it got to that different language.

I think the point is that an “open source project” is more than just the code and license, it’s also the community that builds and maintains it. A fast rewrite of Bun in Rust has effectively alienated most of the people in the Bun community, so in that sense the “open source project” has died. It’s no longer a community project, it’s just become a personal project again.

Just so everyone know, Bun is and has always been owned by a YC funded org with full time employees. The overwhelming majority of commits came from them.

Re: Claude Code uses Bun written in Rust now

#219
post #150

Earlier quoted context omitted.

> TS7 is going to cause problems for downstream users because Go is the wrong language to use for something that has to run in WASM. Is there a huge need to run that typechecking on browsers?

Yes, in the Monaco editor ( https://microsoft.github.io/monaco-editor/ ). It's not just typechecking, the typescript library is also the reference parser for TypeScript and reference emit. Emitting JS from TypeScript is non-trivial and non-local. It's not just in browsers, you might want to run the typescript library on the edge or in some restricted environment where JS/WASM is OK but native code is not. You may wan…

NodeJS can strip types internally without a straight TS dependency. I don’t think this matters, TS was a huge bottleneck for many build pipelines because it never parallelized well

Re: Claude Code uses Bun written in Rust now

#220
post #18
post #5

Earlier quoted context omitted.

Why does changing to Rust kill the project? I don't understand the point here.

It’s made absolutely no negative difference, as we’ve seen in the real world in the last 60 days since the merge. I feel weird having to defend reality; reality being that it was merged nearly 2 months ago and tons of people have had their pitchforks out without a shred of actual evidence that this made bun worse in any measurable way. But they still insist it was a mistake. I’ve never met Jared or the bun team but I…

The outrage was more how the rewrite was communicated and defended, which was objectively poor.
Post reply on HN