Live data from Hacker News

Claude Code uses Bun written in Rust now

simonwillison.net

241–250 of 920 posts

Re: Claude Code uses Bun written in Rust now

#241
post #223

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.

I never knew that running an interactive program in my terminal would absolutely rinse my CPU and battery but that's what Claude, OpenCode and Ghostty have colluded to achieve. Even when the laptop is asleep overnight it's practically melting. I'm sure there was some logical reason for shoehorning web technology into this stack given that we have a good 40 years or so of experience with interactive terminal programs…

[deleted]

Re: Claude Code uses Bun written in Rust now

#242
post #93
post #40

Earlier quoted context omitted.

Rust as a language is irrelevant to this discussion, the problem is that bun was vibe coded by a single dude without any open source community involvement. “bun the open source project” is basically dead at that point: don't expect any of the zig enthusiasts who had their code being forcibly rewritten in a language they don't like to follow Jared. “bun the JavaScript runtime ” is not dead though.

I agree, it's unfortunate the headlines seem to have become 'rewritten in Rust' (not a bad thing) and not 'vibecoded in a week without review' (a bad thing).

Rust as a language is not relevant, but the Rust community still helped to popularize the idea that trashing a community by a rewrite is ok if it serves some "higher goal". This rewrite is just a striking example why this is problematic.

Re: Claude Code uses Bun written in Rust now

#243
post #223

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.

I never knew that running an interactive program in my terminal would absolutely rinse my CPU and battery but that's what Claude, OpenCode and Ghostty have colluded to achieve. Even when the laptop is asleep overnight it's practically melting. I'm sure there was some logical reason for shoehorning web technology into this stack given that we have a good 40 years or so of experience with interactive terminal programs…

Why are you implicating ghostty? Have you compared its CPU usage to any other terminal?

Re: Claude Code uses Bun written in Rust now

#244
post #236

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.

It largely works and it's a massive business success. This is the classic engineer asking the 'why this technology?' to what amounts to a business question. They chose it early on, it works, and it makes obscene amounts of revenue. End of story. That doesn't mean it was the "greatest" choice, or has a perfect technical architecture. Rewrites are never easy, even the bun rewrite. But a non-UI developer tool with a rig…

The criticism didn't appear to me to be that the solution didn't work, just that many of the working solutions we are selecting are dangerously overcomplicated due to shortsighted decisionmaking. The benefits of throwing redundant stacks of abstraction atop each other in terms of time to market are questionable, and obviously absent in every other metric.

Re: Claude Code uses Bun written in Rust now

#245

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've been (grudgingly) using Claude since February.

When I started, I discovered to my shock that it was by far the worst TUI I had ever touched. Rendering glitches, keyboard input screwups, and just all-around jankiness.

Despite that awful baseline, I have to agree that it's gotten noticably worse in the past week or so.

It's started mangling my terminal sessions somehow, so that not all characters I input are visible in the UI.

Backgrounding it, doing a 'reset', then re-foregrounding seems to fix it.

Of course when I asked it to diagnose the problem, it assured me that Claude has no such big and it must be something else I'm running.

All I'm running is tmux and Claude, though, and the behavior surfaced while I was running Claude.

So, yeah - if they just recently updated Claude to use the Rust rewrite, this increased crappiness might actually be due to that. It does seem to at least roughly correlate.

Re: Claude Code uses Bun written in Rust now

#246
post #118

Earlier quoted context omitted.

> Update: The Rust version has been released as Bun canary - running bun upgrade --canary will install this release.)

Does `bun upgrade` provide the source code?

Yes, it provides the commits for a "changelog". Canary builds track main closely, 98f664962 is the tip of main.

~$ bun upgrade [2.42s] Upgraded.

Welcome to Bun's latest canary build!

Report any bugs:

    https://github.com/oven-sh/bun/issues
Changelog:

    https://github.com/oven-sh/bun/compare/f161e0311...98f664962

Re: Claude Code uses Bun written in Rust now

#247
post #223

Earlier quoted context omitted.

I never knew that running an interactive program in my terminal would absolutely rinse my CPU and battery but that's what Claude, OpenCode and Ghostty have colluded to achieve. Even when the laptop is asleep overnight it's practically melting. I'm sure there was some logical reason for shoehorning web technology into this stack given that we have a good 40 years or so of experience with interactive terminal programs…

Why are you implicating ghostty? Have you compared its CPU usage to any other terminal?

I think the author is saying everything that touches llm.

Re: Claude Code uses Bun written in Rust now

#248
post #236

Earlier quoted context omitted.

It largely works and it's a massive business success. This is the classic engineer asking the 'why this technology?' to what amounts to a business question. They chose it early on, it works, and it makes obscene amounts of revenue. End of story. That doesn't mean it was the "greatest" choice, or has a perfect technical architecture. Rewrites are never easy, even the bun rewrite. But a non-UI developer tool with a rig…

The criticism didn't appear to me to be that the solution didn't work, just that many of the working solutions we are selecting are dangerously overcomplicated due to shortsighted decisionmaking. The benefits of throwing redundant stacks of abstraction atop each other in terms of time to market are questionable, and obviously absent in every other metric.

Correct

And the question of “if AI is so amazing, shouldn’t it enable easy development of a native TUI even if JS is easier at first?”

Don’t get me wrong I find great value in coding agents daily. Just finding the hype cycle tiring.

Re: Claude Code uses Bun written in Rust now

#249
post #233

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.

Why would rewriting Claude code, an app which probably has 30-40 (I might be significantly underestimating) extremely active contributors be easier than rewriting Bun, which has fewer contributors and almost certainly also less lines of code?

Because I’ve been told that Fable can do anything :-)

My question is moreso “why was it ever JS in the first place”

& the cost of a native rewrite would be cheaper than acquiring Bun no matter how you shake it

Re: Claude Code uses Bun written in Rust now

#250
post #223

Earlier quoted context omitted.

I never knew that running an interactive program in my terminal would absolutely rinse my CPU and battery but that's what Claude, OpenCode and Ghostty have colluded to achieve. Even when the laptop is asleep overnight it's practically melting. I'm sure there was some logical reason for shoehorning web technology into this stack given that we have a good 40 years or so of experience with interactive terminal programs…

Why are you implicating ghostty? Have you compared its CPU usage to any other terminal?

I don't know if its still the case anymore since 1.3 but Ghostty did have a documented issue with Claude causing resource issues.
Post reply on HN