Live data from Hacker News

Claude Code uses Bun written in Rust now

simonwillison.net

401–410 of 920 posts

Re: Claude Code uses Bun written in Rust now

#401

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…

> Rust does this automatically.

A garbage collected language does this automatically. Rust still requires thinking about and tracking memory lifecycles, but the borrow checker will complain and keep you from doing it wrong. That's why LLMs like Rust. It gives immediate feedback on what to fix. By-default constant reference parameters helps prevent major performance problems.

Re: Claude Code uses Bun written in Rust now

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

It doesn’t work, it performs horribly and is full of bugs. Serious people use open harnesses.

Re: Claude Code uses Bun written in Rust now

#403
post #252

Earlier quoted context omitted.

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

Of course I have. If I see ghostty constantly consuming the most energy and helping reduce my battery life to barely 2 or 3 hours, the first thing I'm going to do is switch terminal to see if I can improve that situation. The built in terminal and WezTerm have been fine and I've had much more reasonable battery life since. This does not even speak to it pegging my CPU and keeping the fans running on full blast even w…

This seems a suspicious. How do you measure the CPU load of Ghostty? Is the measure/reporting method just attributing the cpu load of the commands/programs you're running in Ghostty to Ghostty?

You could test this by running "yes > /dev/null" in Ghostty. In Activity Monitor on my Macbook it shows `yes` using 100% and Ghostty using 0.5% of cpu.

Re: Claude Code uses Bun written in Rust now

#404
post #273

Earlier quoted context omitted.

They succeeded in spite of their tech choices. Their model outshone it, which is an extremely rare thing to happen and not something they could've counted on. In any other timeline they could've/would've been hurt by their choices. It's like "why did you go all in on buying scamcoin 3.0 as your investment strategy?" -- "I 5xed my money! End of story! It was fine!"

> They succeeded in spite of their tech choices. Or those choices just don't matter, it's fundamentally just "tabs vs spaces".

If they don't matter why isn't GTA6 being built in React?

Tabs vs spaces makes no tradeoffs. Tech choices do

Re: Claude Code uses Bun written in Rust now

#405

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.

Cause it works, most users are fine with it, people don't migrate off it because of the codebase, and easier to maintain if the dev team is familiar with code flow.

This is close to the same "why Spotify is a chromium embed?" question. Because it works, and users are ok with it.

Re: Claude Code uses Bun written in Rust now

#406
post #347

Earlier quoted context omitted.

Code isn’t what the majority of software engineering is.

Pointless nitpicking that completely missed my point. Software developers are not the hardest to replace, so your presumption that everything else should be easier is wrong.

Next time, try being polite, it’ll make me way more inclined to engage with you.

If I missed your point it was unintentional. Instead of being rude, try gentle clarification.

But now I’ve lost interest. Have a good day!

Re: Claude Code uses Bun written in Rust now

#407
post #323

Earlier quoted context omitted.

The fundamental problem with all Js based apps is how they are very single threaded. With js you get 1 thread at 100% utilization. Power usage and heat scale non-linearly with cpu utilization and 100% utilization on a single threaded js app means you will have ui lag. Other languages like golang would split work across 8 threads and have 8 threads at 20% utilization and this would result in less power usage. Claude C…

That’s not really a big issue. In major OS like the BSD, SMP implementation are not that old. If we can have a full OS running in single core mode, we can have an application being performant too. I’m currently running OpenBSD on 4 cores and it’s basically 99% idle. Bad coding is just bad coding.

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.

Re: Claude Code uses Bun written in Rust now

#408

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…

> Reminder that the Bun's Zig-to-Rust rewrite took 11 days with dozens of agents working 24/7 and the author put the cost they'd pay (if they had to pay) at about $168k. For an entity like Anthropic that's not even the cost of a single developer for a year. It's closer to what they pay a chef on premises. That the showstopper for a better Claude agent is that they'd need to pay $168k or event $1M or even $10M in cost…

I don't work for them and I don't know their priorities. I can only speculate they're not okay with it but no idea why exactly.

Re: Claude Code uses Bun written in Rust now

#410
post #83

Earlier quoted context omitted.

>Literally who cares what language a JS toolset is written in? Maybe you're being coy by asking a rhetorical question you already know the answer to but I'll answer as if you asked sincerely... There are 2 different groups interacting with software products: (1) end-users : this is where the "Who cares what language it's written in?!?" is usually applicable. E.g. The finance guys using MS Excel don't care whether it'…

What about Group x. You just AI generated 1 millions lines of code claiming it's for safety. Who exactly is to make any kind of security guarantees about this?

What was your safety guarantee pre-rewrite? If CVE scanners and aggregators is your answer, then well, this applies to post-rewrite as well.
Post reply on HN