Live data from Hacker News

Claude Code uses Bun written in Rust now

simonwillison.net

591–600 of 920 posts

Re: Claude Code uses Bun written in Rust now

#591

Earlier quoted context omitted.

Sometimes I think that if we are willing to burn tokens and rely on compilers in a loop we should be using languages that can catch as many errors as possible at compile time. Like Ada or Ocaml or Haskell or something. Or even require like MC / DC testing or MISRA C verification. Or even some of the languages that apply Hoare checks, like Ada SPARK or FRAMA-C or VALE or whatever. I don't have the budget to test how t…

I presume haskell applications similar to claude code are well represented in the training data.

There was a post recently from a guy who used Haskell with AI agents. If I remember correctly he said the type checking did catch errors. The problem was the compiler was very slow, which slowed down the feedback loop and output. I think he switched to Python.

Re: Claude Code uses Bun written in Rust now

#592

Earlier quoted context omitted.

Formatted hyperlinks are an escape code too. It has nothing to do with React. Not sure why you’re trying to bring up experience as a justification for using React to render a tui and all the downsides that come with that.

It sounds like you completely missed the point I was making: that actually implementing such a highly dynamic TUI application normally requires a significant amount of state tracking and it is significantly easier to write such apps using a functional, descriptive UI framework instead of something like ncurses. Take it from someone who, in those 24 years, has written UIs in jquery, react and ncurses (and yeah I've tr…

CC is not even that complex of a TUI. It’s certainly not as complex as many of the GUI programs I use daily. And yet it’s by far the buggiest and worst performing. I don’t understand the desire to make excuses for this. The reason people use it is because it’s the only way they can afford to use Opus and Fable. If Anthropic let people use their subs with other harnesses their market share would plummet.

If they could migrate an entire runtime to Rust why can’t they migrate CC? It’s not as if React is the only way to do declarative UI.

Re: Claude Code uses Bun written in Rust now

#593
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…

No, it's because they wanted a unified pipeline in claude code, claude app, and their website. All of them use more or less the same claude features (claude code has artifacts, claude website has "Ask User a Question" tool, etc.).

Much less fragmented compared to "write the app 3 times in 3 different languages".

Re: Claude Code uses Bun written in Rust now

#594
post #357
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…

I have been working all day every day in Claude. I loathe their bug-ridden UI. Every release is a new crop of bugs, sometimes the old ones get fixed, usually not. Any kind of scrolling back, copying text, using their menu system - basically anything that isn’t typing characters has had/still has unaddressed bugs. OpenAI shipped a competitive model and I’m over in Codex now. I have yet to hit a bug. If you’re holding…

The vim mode in that text box was a mess for sure

Re: Claude Code uses Bun written in Rust now

#595
post #407

Earlier quoted context omitted.

It's basically idle because it's not doing anything. If you are streaming in markdown and code and then doing syntax highlighting on this code in real time, then rendering it on the screen you are doing actual work. It's also all cpu bound work. The majority of the stuff on your screen is being rendered by the gpu.

> If you are streaming in markdown and code and then doing syntax highlighting on this code in real time, then rendering it on the screen you are doing actual work. You are really, really not. Not at LLM inference speeds at least. Frontier models output maybe 200 bytes per second on the fast end. I guarantee you that idle BSD box is still processing more than 200 bytes of whatever at any point in time. Streaming 200…

Processors today are very fast. If you are spiking it on rendering diffs, you’re doing it wrong. I can’t even stress it building openbsd’s kernel.

Re: Claude Code uses Bun written in Rust now

#596

Bah. Personally my take on the entire affair is quite negative, whatever Jarred or Simonw says about it. I think Bun owned by Anthropic and the entire rewrite with AI is not the real point (even if it's quite interesting, though). My take is that Jarred, and Bun,didn't demonstrate a serious, adult approach, from "this is my branch, you are overreacting" message to just proceeding with a 1mil+ PR merged in less than m…

There's literally nothing stopping anyone from continuing the Zig version if they want to

Re: Claude Code uses Bun written in Rust now

#597

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’m not sure what else can you use to share the same business logic between website frontend, desktop gui and tui apps and backend

Re: Claude Code uses Bun written in Rust now

#598
post #340

Earlier quoted context omitted.

Can't have been that cheap if they thought buying Bun for an undisclosed amount of money was cheaper.

I don't think they bought them just for the claude-code gui harness as it is now. it's to have strategic control over some software runtime they can use to do other things related to verification, deployment, and end to end value delivery. Same reason other companies are buying up dev tools.

Yeah it was a little tongue-in-cheek--I think the estimate I saw was over $100M for bun, which would have been enough to pay Donald Knuth to rewrite Claude Code, let alone AI.

Re: Claude Code uses Bun written in Rust now

#599
post #209

Why all the mess with Bun? Couldn't they have rewritten Claude Code in Rust directly? No more need for a JS runtime, better performance, etc... If their agents can do Zig to Rust, why not JS to Rust?

Is Claude Code bottlenecked by performance? I think a JS runtime is fine because the ecosystem of tools is very large and plugins are easy.

Why is ecosystem of tools and plugins a bottle neck when they literally own Claude models and as per their boss, code is so cheap that anything us just an English sentence away?

Re: Claude Code uses Bun written in Rust now

#600
post #328

Earlier quoted context omitted.

Bun is riddled with bugs. That's what moving fast and breaking things gets you. It gets you famously bad codebases that are nightmares to work with and slow you down over time as your sins catch up with you. Vibecoding is not enough.

Then why do you care? If target users (developers) face issues with bun, they will stop using it. Go back to Node or switch to Deno. Bun has bugs? yes. Do they affect vast majority of users? Not really. Been using bun for about 3 years; never had an issue with it.

Are you interested in the discussion that was taking place before you popped in or are you just here to get outraged that something you clearly identify strongly with is getting criticism for making poor choices?

"Because the discussion was interesting" is why I care.

Post reply on HN