Things get pretty hilarious when you super safe language conrains the keyword "unsafe" :D
I wonder what are the real legitimate use-cases for "unsafe" in the first place, it is there for a reason?
Things get pretty hilarious when you super safe language conrains the keyword "unsafe" :D
I wonder what are the real legitimate use-cases for "unsafe" in the first place, it is there for a reason?
Many. Let me give you a very boring example: I use mmap in some of my programs, because it's the easiest/best way to solve the problem I was working on. Mmap is unsafe in rust, because if there are modifications to the backing file it can violate some of rust's assumptions about the behavior of memory not changing unless it was changed by the rust code.
In my application I'm able to guarantee that there is no modification to the backing file by making them read-only and ensuring nobody messes with them, but that guarantee exists outside of rust. So -- unsafe with a big SAFETY comment explaining the requirements if you use it.
Much rust code will never use unsafe. Systems code is likely to use a bit but also to know what it's doing.
Things like this port of bun are unusual and presumably transitory on the way to an implementation with minimal use of unsafe.