Live data from Hacker News

Claude Code uses Bun written in Rust now

simonwillison.net

811–820 of 920 posts

Re: Claude Code uses Bun written in Rust now

#811
post #793

Earlier quoted context omitted.

An "unsafe" in rust is like an axiom in mathematics. You can use to prove higher level theorems but it has to make sense. The second that you start to introduce nonsensical axioms (or bugs in unsafe sections) all your proven correct theorems will be worthless.

But code is not mathematics, so incorrect code is not worthless, it’s just worth less. It’ll most likely still do 99% of the things people need it to do, there’ll be a an issue created for that broken 1%, and eventually it’ll be iterated upon and fixed. Unless you’re working on a security boundary of course, there you should treat it like maths.

Rust doesn't check for logical errors, it checks for memory errors. So every single issue in an unsafe section is a potential CVE.

Re: Claude Code uses Bun written in Rust now

#812
post #376

Earlier quoted context omitted.

Zig (like C) is simply not a good language to use if you're going to do many small allocations with uncorrelated lifetimes. To write robust Zig (or C) code, you must manage lifetimes yourself, for example by grouping allocations on an arena or by having fixed buffers of "things". You can just do that, and then Zig is really no less robust than Rust. But if you want to do "managed language" style allocation patterns (…

> You can just do that, and then Zig is really no less robust than Rust. If you just don't write bugs, then yes all languages are equally robust, including assembly. Zig, like C, is simply not a robust language. I don't know why this feels like something contentious? It's clearly not intended to be robust?

> Zig, like C, is simply not a robust language

"Extraordinary claims require extraordinary evidence" -- Carl Sagan

Re: Claude Code uses Bun written in Rust now

#813
post #811

Earlier quoted context omitted.

But code is not mathematics, so incorrect code is not worthless, it’s just worth less. It’ll most likely still do 99% of the things people need it to do, there’ll be a an issue created for that broken 1%, and eventually it’ll be iterated upon and fixed. Unless you’re working on a security boundary of course, there you should treat it like maths.

Rust doesn't check for logical errors, it checks for memory errors. So every single issue in an unsafe section is a potential CVE.

Of course, but even the presence of CVEs does not make software worthless, it just makes it worth less.

Re: Claude Code uses Bun written in Rust now

#814

Earlier quoted context omitted.

To the man with a hammer…

This saying has been abused 10 ways til Sunday. "I'm using technology I know that will get us there" is not the same as treating every problem as a nail. It's making a practical choice that probably also had time constraints and other factors we don't know.

I think it’s completely applicable here. Nobody who worked in the 80s or 90s would have selected this solution.

Re: Claude Code uses Bun written in Rust now

#815
post #663

Earlier quoted context omitted.

Can you elaborate on the unusual part?

All necessary memory is allocated at initialization. The application is not allowed any allocations during it's normal runtime. This is how it avoid memory bugs. Not a lot of people write programs this way.

I do. The only thing I need dynamic allocations for is queues of asynchronous events, and that's just because I'm too lazy to calculate an upper bound for how many there may be.

Re: Claude Code uses Bun written in Rust now

#816

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…

[dead]

Re: Claude Code uses Bun written in Rust now

#817
post #747
post #639

Earlier quoted context omitted.

Why not using Swift?

Andreas Kling talked about it. It boils down to C++ interop sucks (no surprise for lang made by Apple), ecosystem is tiny, Rust works well enough with LLMs. https://youtu.be/DbHjKi_jASY

He just wanted to use LLMs for coding, and not enough training data on Swift code exists for his use case. Admitting to that would be rather silly, so here we have this sentiment now exist rent free in people's brains.

The C++ interop of Swift is perfectly fine, to such a degree that FoundationDB is now using it effectively alongside its C++ origins.

Re: Claude Code uses Bun written in Rust now

#818
post #670

Earlier quoted context omitted.

"Fun fact", it lets you largely circumvent the borrow checker by creating arbitrary lifetimes: https://news.ycombinator.com/item?id=48974824

People are so funny about rust. “Safe rust isn’t expressive enough!” -> then use unsafe rust. “Unsafe rust lets you do anything! Even crazy things!” -> then use safe rust. Or just don’t write crazy code? Does bun actually do anything insane like that in its unsafe blocks? Or are you just fear mongering?

> Does bun actually do anything insane like that in its unsafe blocks?

How would anyone even know, it's vibe coded.

Re: Claude Code uses Bun written in Rust now

#819

Earlier quoted context omitted.

It's a weird way to frame the event. Yeah, Andrew (Zig)'s responses were astonishingly immature, but it doesn't matter. Even if Andrew literally ate baby seals for breakfast and kicked puppies as a hobby, it wouldn't make Bun look better. You'd notice that the parent comment didn't even mention zig at all.

Saying Bun's communication was an issue here is clutching pearls. There is no evidence that Bun ever acted in bad faith, Jared definitely seemed to initally think it was just a trial, until he realized that it was actually something feasible. He isn't clairvoyant; there is no way he would have known it was going to be successful when he initially made the post.

Bun isn't Bun, it's a (notionally) trillion dollar AI company famous for ruthlessness and engineering controversy for marketing purposes. Zig just happens to be a language led by someone with an AI-skeptic philosophy. Are you saying I should just believe that their strategically deniable negative insinuations about Zig are not bad faith?

Sorry, but I'm calling bullshit. I know there's no absolute smoking gun here, but it's all a bit too cute to be unintentional. They are very very smart people. They knew what they were doing.

Re: Claude Code uses Bun written in Rust now

#820

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…

i found the same thing with Rust, verification steps are really helpful for speed and correctnesss
Post reply on HN