Live data from Hacker News

Claude Code uses Bun written in Rust now

simonwillison.net

361–370 of 920 posts

Re: Claude Code uses Bun written in Rust now

#362
post #180
post #175

Anecdotal, but I’ve been getting segfaults in Claude Code. I run inside Kitty tabs, and the entire tab becomes unusable when this happens. No response to inputs at all from that point. When this happens, a link shows up to report the issue. It’s not clickable (likely due to the segfault), and perhaps more important: it’s encoded, so you can’t see what you would be sending in your report. Hope it gets better.

What makes you think it's a segfault? Does your shell print "Segmentation fault"? If so, you should be back at your shell and you should be able to recover the tab by typing 'reset' + enter (even if you can't see anything as you're typing it). If nothing prints "Segmentation fault", this just sounds like a hang

I just had this happen today. It was indeed a segfault.

From what I could tell it looked like it was in JS code that had been JIT compiled. I haven't attempted to troubleshoot further beyond setting all my future Claude Code instances to pipe their stderr to disk so that I don't lose the stack trace next time.

Re: Claude Code uses Bun written in Rust now

#363
post #266
post #91

Earlier quoted context omitted.

> that this made bun worse in any measurable way Issues on GitHub was mass closed claiming zig is no longer relevant without fixing the real issues.

Whole classes of bugs WERE fixed by moving to rust. wouldn’t that result in mass closures of classes of bugs that were no longer relevant in rust? What would you prefer?

I would prefer they confirm before closing. It's AI / bot anyway. Instead it's just mass keyword zig = close. The bug can still exist post-port. None of it got "fact-checked".

In fact a lot of "feature requests" like npm compatibility related or missing specs etc ALL also got closed for being "zig" because reproduction and suggested solution were of course zig.

Again doesn't mean it got "auto fixed".

Re: Claude Code uses Bun written in Rust now

#364

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.

Anything that can be written in JavaScript will be written in JavaScript. That's just how it is it seems.

Re: Claude Code uses Bun written in Rust now

#365

Earlier quoted context omitted.

> But the whole point of their product is that it supposedly nullifies such "business" concerns around the use of technology, by making it cheap and fast to build whatever you like automatically. This is a spectrum, it's not just 0% vs 100%. Even Fable frakked up a few things really badly in my professional work (though to its credit after a very detailed 2h chat it self-corrected and fixed all the blunders). I would…

> $168k Billions of dollars of annual revenue go through Claude Code, and the people who work on it must be a lot of millions in headcount. The time matters a fair bit, it's probably time someone can't spend breaking things in the name of new features, but if rewriting the stack had even a tiny impact on retention or driving higher usage, it would pay back that $168k.

Yep, same thought. And it seems Anthropic agrees.

Re: Claude Code uses Bun written in Rust now

#366

Earlier quoted context omitted.

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?

What's the point of rewriting it to Rust if you're going to, on purpose, disable the most prominent benefits of using Rust?

It isn't disabled, it has exclusions. Now that they have it, they can close the gaps. It was literally impossible to have ANY coverage before, now they are mostly, covered and have an avenue for remediation.

I don't understand why folk are having such a hard time understanding why you do large projects in multiple steps? 80/20 rule? Perfect is the enemy of good?

Was nobody here for moving billions of lines of JavaScript to Typescript? It starts with declarations, then turn on type checking gradually inside the codebase: piece by piece until done.

Re: Claude Code uses Bun written in Rust now

#367

Earlier quoted context omitted.

Yeah. One single project that they control. Not thousands of other people's projects breaking, I'm sure with a ton of HN outcry over releasing "this pile of vibe coded slop" upon the poor populace. You just can't win.

> you just can’t win You could! You could not release a “pile of vibe coded slop” onto people’s machines. There don’t even appear to be any particular advantages to Claude upgrading early. If there are no one has been made aware of it.

The irony. A company building models and tooling to automatically produce code being attacked for using automatically produced code in the very tools that allow people to automatically produce code, presumably by somebody who wants to use their tools to automatically produce code, possibly because they believe that their approach at ensuring that automatically produced code is properly reviewed by a responsible human has to be more thorough than whatever that company does because of course they were going too fast and thus it can't be good

Re: Claude Code uses Bun written in Rust now

#368
post #98

What is the actual contribution and motivation of this post?

[flagged]

I've not made any money at all from Anthropic.

You can see my list of previous weekly blog sponsors here: https://simonwillison.net/dashboard/sponsor-history/

None of them get any influence on my content. That would hurt my credibility, and my credibility is the reason my site is worth sponsoring in the first place.

Honestly, if OpenAI or Anthropic offered to sponsor I'd probably turn them down. The optics of taking sponsorship from companies that I frequently write about are not great.

Re: Claude Code uses Bun written in Rust now

#369

Earlier quoted context omitted.

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?

My conclusion was formed in my two months long tracking of the repo activities. They have done absolutely nothing in that front. (Well, to be precise they tried to fix exactly one thing that was pointed out but that's it) > must interface with C code that has no safe interface Yeah so the sane first step is to create encapsulated, safe interface for them, especially in a project like this. Deno for instance have ~0.2…

> I'd remind you the current new version is not an improvement compared to the previous one, both in terms of correctness and maintainability.

Except, you know, multiple real companies saying that it is and using it in production. And the fact it closed all known memory leaks. And that nobody has a really pointed to a single actual issue the new version introduced after two months of endless, ceaseless bitching.

I'm also fascinated by all these people upset at Jarred for harming the readability of a codebase they've literally never cared about before it become drama. Bun has almost exclusively been maintained by Oven employees since it's inception.

> Deno for instance have ~0.2x as many unsafes.

A project written ground-up in Rust idiomatically, with a smaller surface area, still has an unsafe footprint within an order of magnitude compared to this automated rewrite from an unsafe language with different practices and known bugs? That's not exactly the slam you think it is.

Re: Claude Code uses Bun written in Rust now

#370

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.

Otherwise an idle TUI wouldn't halve my laptop's battery life. Maybe that's an exaggeration but not that much, based on looking at wakeups in powertop.
Post reply on HN