Live data from Hacker News

Claude Code uses Bun written in Rust now

simonwillison.net

511–520 of 920 posts

Re: Claude Code uses Bun written in Rust now

#511

Drilling 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…

LLMs catch memory bugs quite easily in my experience.

All of this is just a (succesful) marketing stunt by Anthropic.

Re: Claude Code uses Bun written in Rust now

#512

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.

As a counter argument - I assume that Anthropic is using AI to write Claude Code. I've read and heard in videos that Javascript is a pretty good language for AI to write code in. Apparently this is because there is so much training data out there. Also Javascript avoids problems of multi threading and memory management that can mess up the AI in other "more performant" languages. So maybe Javascript is not the worst…

I feel like a year ago JavaScript and Python were the best languages for coding agents to use because of their heavier presence in the training data, but I'm not sure that's true any more now.

The latest frontier models are competent at Rust and Swift and all manner of other less widely used languages.

The more important factor is how good they language's compiler is at kicking out actionable error messages, since one-shot code generation isn't as important once you have a coding agent loop.

Re: Claude Code uses Bun written in Rust now

#513

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.

If only paying the $168k was some sort of a guarantee. Vibing doesn't give you that.

You might get more maintainable code for $168k by hiring humans, but if its something bespoke it isn't going to get you far (or far quickly).

Vibing is straight out gambling right now, the thing is, I don't know who the house is any more.

Re: Claude Code uses Bun written in Rust now

#515

Maybe I'm taking crazy pills, but I swore there have been very similar comments I've seen as the current top post by weakfish: > 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. >…

Maybe because the 1st thing any experienced technical person would think about? It's like rebuilding and optimizing the racing track to make F1 run faster.

Re: Claude Code uses Bun written in Rust now

#517

Earlier quoted context omitted.

> $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.

The company I work for is about 15mm into what is effectively a rewrite. Just a lone data point…

Millimeters?

Re: Claude Code uses Bun written in Rust now

#518
post #351

Earlier quoted context omitted.

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

Probably because it consumes the same APIs originally developed for a web app and the same front end engineers likely created Claude Code. People assume Anthropic set out to create Code as a product and went through a normal design phase. I think it’s more likely it started as an internal tool or someone’s side project and blew up as a product when they released it to the public.

But isn't the point of an API that it abstracts away the language(s) in which your application is written?

Re: Claude Code uses Bun written in Rust now

#520
post #192

Earlier quoted context omitted.

Afaik, under current US law (Thaler v. Perlmutter 2025^), "the Copyright Act of 1976 requires all eligible work to be authored in the first instance by a human being". With regards to AI-generated code, this means the copyrightability (at all , not with regard to who owns it) turns on whether or not a human was substantially involved in its creation. Existing decisions require evidence of pretty heavy and continued h…

Couldn't it be argued that Bun-Rust is still MIT licensed, because the old implementation was "in the first instance" authored by a human? All the machine did was translate it. I think it's the "infringing usage" question that is more interesting. If the LLM trained on GPL-derived code, what does that mean for the end result?

Yeah you could argue that, but it's a messy argument. I'm wiling to imagine that they hadn't used AI to do the rewrite to Rust. It wouldn't have been all that hard to do with plain old syntax tree transformation (my expertise). The trickier question for me is the ownership at the boundary where prompts were turned into Zig code. That is not a process that could have been done with syntax tree transformation: creative freedom was given to the model as to how to do the work at that stage, and so that is the stage at which I'm least sure they could legally defend their claim to ownership.
Post reply on HN