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.
Claude Code uses Bun written in Rust now
811–820 of 920 posts
Re: Claude Code uses Bun written in Rust now
#812Earlier 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?
"Extraordinary claims require extraordinary evidence" -- Carl Sagan
Re: Claude Code uses Bun written in Rust now
#813Earlier 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.
Re: Claude Code uses Bun written in Rust now
#814Earlier 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.
Re: Claude Code uses Bun written in Rust now
#815Earlier 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.
Re: Claude Code uses Bun written in Rust now
#816Drilling 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…
Re: Claude Code uses Bun written in Rust now
#817Earlier 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
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
#818Earlier 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?
How would anyone even know, it's vibe coded.
Re: Claude Code uses Bun written in Rust now
#819Earlier 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.
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
#820Drilling 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…