47
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
this post was submitted on 13 Jul 2026
47 points (94.3% liked)
Programming
27744 readers
477 users here now
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Rules
- Follow the programming.dev instance rules
- Keep content related to programming in some way
- If you're posting long videos try to add in some form of tldr for those who don't want to watch videos
Wormhole
Follow the wormhole through a path of communities !webdev@programming.dev
founded 3 years ago
MODERATORS
The answer to Bun's memory bugs was to follow a style guide. Not allocating dynamically stems from the style guide used by a mission-critical financial transactions database. Bun didn't have to use that style guide, and honestly it would have been overkill. They could have easily adopted a different one, modified one to suit their needs, or made their own.
In general, I agree that Rust does a far better job at preventing these kinds of bugs than a style guide does, but Bun didn't even try one and decided instead to ask Claude to rewrite it in Rust.
To be honest I don't see how a "style guide" is going to help. C++ has had all sorts of guidelines and style guides for decades and it helps a bit but... not really.
What does the Zig compiler's own style guide say about avoiding memory errors? As far as I can see nothing?
Is this style guide not a style guide?
It does help though without requiring a complete rewrite in another language, which is prone to causing entirely new issues and reintroducing old, fixed ones.
Like I said, Rust does a much better job at avoiding these. "Claude rewrite this in Rust" doesn't give you those benefits for free.
It's a start, but doesn't say much about methods to avoid the memory issues that they supposedly had issues with. If they intended to actually use it, maybe it'd have more than 7 commits from 8 months ago. Maybe they would have updated it with patterns to prevent new bugs in the future based on the bugs they ran into. That didn't happen, though.
Well it seems a bit hollow for the Zig developers to say "there's no problem - just use a style guide!" when they themselves don't even use one and the only one they can point to just says "never dynamically allocate".
Bun specifically called out TigerStyle. Given that they were responding to this article, it's not a surprise they defended TigerBeetle.
All it takes is one internet search with the words "zig style guide" to find countless examples to pull from online. The Bun devs are entirely to blame for choosing not to create or follow one, and that decision, if I had to guess, stems from their refusal to do any actual software development themselves and instead rely on LLMs to do everything for them.
Maybe they could have asked robobun to open a PR to add a style guide?
"Countless"? You should be able to find, say three style guides that talk about how to prevent memory errors then right? Because my one search didn't find any.