Live data from Hacker News

Claude Code uses Bun written in Rust now

simonwillison.net

571–580 of 920 posts

Re: Claude Code uses Bun written in Rust now

#571
post #515

Earlier quoted context omitted.

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.

I have ~24 years of experience coding and the LAST thing I think about when opening claude code is "why is this written in react". Tell you what I sometimes think about though: The fact it has clickable links and complex formatting rules for markdown, the most interactive and highest-quality clickable interface I've ever seen in a terminal, and somehow manages to work. That actually blows my mind. THEN, I'm reminded…

You’ve been writing code for 24 years and you don’t know that clickable links are a terminal emulator feature and not a Claude Code feature? Or that “markdown formatting” is just ansi escape codes, and possible with things other than React that don’t bring so many downsides?

Re: Claude Code uses Bun written in Rust now

#572

Earlier quoted context omitted.

I have ~24 years of experience coding and the LAST thing I think about when opening claude code is "why is this written in react". Tell you what I sometimes think about though: The fact it has clickable links and complex formatting rules for markdown, the most interactive and highest-quality clickable interface I've ever seen in a terminal, and somehow manages to work. That actually blows my mind. THEN, I'm reminded…

You’ve been writing code for 24 years and you don’t know that clickable links are a terminal emulator feature and not a Claude Code feature? Or that “markdown formatting” is just ansi escape codes, and possible with things other than React that don’t bring so many downsides?

Claude Code is able to hyperlink any kind of text, not just the native terminal emulator feature of hyperlinking anything starting with https://...

And your "it's just ANSI escape codes" is the weirdest take on any kind of software.

Re: Claude Code uses Bun written in Rust now

#573

Earlier quoted context omitted.

So, you have a vibe-coded TUI which happens to work, and then, as a workaround you vibe-translate its engine to make it more performant. Where does that leave you ? Basically, fully dependent on AI to fix whatever breaks. Workaround on a workaround is the way I see it, and it aligns with the AI design mentality in general. For a variety of usecases, this might still be a win in terms of overall cost. But, for softwar…

Bun was not ported to Rust for performance reasons and its not clear to me how anyone can think it was. The reason they've given is memory safety.

Plus 1) There's much more reusable open source code written in Rust than in Zig 2) There are more Rust developers than Zig developers.

Re: Claude Code uses Bun written in Rust now

#574
post #515

Earlier quoted context omitted.

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.

I have ~24 years of experience coding and the LAST thing I think about when opening claude code is "why is this written in react". Tell you what I sometimes think about though: The fact it has clickable links and complex formatting rules for markdown, the most interactive and highest-quality clickable interface I've ever seen in a terminal, and somehow manages to work. That actually blows my mind. THEN, I'm reminded…

Okay and as someone who would rather just straight up use cursor than claude code, I'd rather have my software not crash out on me every 5 minutes. What sort of self respecting dev purposely uses broken software? Even opencode (use it on nonwork computers) is fully better at this point.

Re: Claude Code uses Bun written in Rust now

#575
post #565
post #547

Earlier quoted context omitted.

It's going to take an order of magnitude longer though, delaying any of that revenue significantly. I'm sorry, but we're talking 11 days here. What does "maintainable" even mean with impossible time-scales like this now!?

Perpetual complete rewrites. When there’s more bugs the LLM can fix, rewrite the whole codebase. Repeat ad infinitum.

True on the premise, remains to be seen if that's what's going to happen in practice.

In my work I have Fable/Opus add bespoke linters and tie them to verify/precommit tasks (including in CI) so nothing of the reworks and 15+ initiatives we have in flight ever regresses.

Some discipline will remove that worry of yours. It's not nice to immediately assume that the rewrite's orchestrator (Jarred) did not use discipline. He even outlined a few false starts.

Re: Claude Code uses Bun written in Rust now

#576

Earlier quoted context omitted.

You’ve been writing code for 24 years and you don’t know that clickable links are a terminal emulator feature and not a Claude Code feature? Or that “markdown formatting” is just ansi escape codes, and possible with things other than React that don’t bring so many downsides?

Claude Code is able to hyperlink any kind of text, not just the native terminal emulator feature of hyperlinking anything starting with https://... And your "it's just ANSI escape codes" is the weirdest take on any kind of software.

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.

Re: Claude Code uses Bun written in Rust now

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

This reply makes no sense in this context, though. Sure, it exploded in popularity based on whatever random tech choices were made. But now, when apparently they're deciding there's a problem there, why unleash $150k of tokens to rewrite a JS runtime wrapper from Zig to a million lines of rust, rather than simply rewrite Claude Code itself to rust?

This speaks for the benefits of JavaScript runtimes like Bun and Node.js. JavaScript is a dynamically typed language which makes it a good choice for explorative programming. It is a Lisp in sheeps' clothing.

Programs which need more stability and performance than exploration are better done in statically typed languages like Rust. Therefore Bun is a platform for JavaScript programming, but itself is written in Zig or Rust.

Re: Claude Code uses Bun written in Rust now

#578

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.

The answer is those are the tools their lead engineers knew, so they repurposed them rather than learning other paradigms .

To the man with a hammer…

Re: Claude Code uses Bun written in Rust now

#579
post #508

Earlier quoted context omitted.

> And then we have a bunch of folks assuming they know better about C that its own authors? Barthes aside, C's changed a lot in the years since they left.

Yes they stopped caring after C89, Plan 9 C compiler was a mix of C89 with extensions. Still they are the authors, and withdrawing from WG14, going their own direction with Alef, Limbo, and finally Go, kind of proves the point they considered C done for its original purpose.

> kind of proves the point

I don't think it proves anything other than the wanted to work on something else.

Re: Claude Code uses Bun written in Rust now

#580
post #512

Earlier quoted context omitted.

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

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.
Post reply on HN