Hacker News new | ask | show | jobs
by lolinder 714 days ago
This kind of dogmatism is why people think Rust will be impossible to adopt. All `unsafe` means is that the code inside the block doesn't have Rust's guarantees and should be inspected extra carefully by hand, much the same as you'd ideally inspect every single line of C. If sprinkling `unsafe` everywhere allows an organization to quickly adopt Rust's guarantees elsewhere and they're aware of that caveat (hard not to be given the naming) that can only be a net improvement over doing the entire thing in C.

You can always go through and systematically remove unnecessary `unsafe` later if needed, but there's no need to do so upfront if that would prevent adoption.

1 comments

there's literary two other patterns on the one example in this thread...

refactoring those unsafe will never happen in the kind of place that put them in place to begin with.