> clear well-scoped unsafe boundaries
This is not done by blindly porting Zig code 1:1 and calling it a day. You do have to make conscious decisions about code architecture to manage Unsafe code, since you need choose the right invariants for your Safe Rust code to conform inside the module (Note that unsafe pollutes the whole module containing it, not just the code inside the unsafe block!)
There's only one language that's more dangerous than C and that is unsafe Rust. I say that only half-jokingly.
No one involved in the port proposed "blindly porting Zig code 1:1 and calling it a day". From the first blog post the creator said:
> We can gradually refactor it to reduce unsafe usage and look more like idiomatic Rust after Bun v1.4 ships.
What the rewrite does is make the unsafe code greppable, which is a necessary first step to eliminating it and one that's actually achievable rather than going straight to idiomatic.
Every successful refractor takes this form of stepwise changes that leave the behavior intact. It just so happens that in this case the first stepwise change was the implementation language.
There is almost zero reason for a public facing, non-embedded project like Bun to use unsafe anywhere.