Re:Dashmap: Fast concurrent HashMap for Rust
by rat9988 on Friday March 27, 2020 @04:31AM
(#22701224)
unsafe doesn't mean dangerous or hazardous. If we cannot verify safety then it's unsafe. The word's choice seems correct to me. I agree with the rest of your comment though.
Another name that came to my mind was trustme as you as the programmer have to uphold certain garantuees that outside an unsafe block the compiler would enforce.
Re:Dashmap: Fast concurrent HashMap for Rust
by steveklabnik on Friday March 27, 2020 @02:12PM
(#22705244)
Re:Dashmap: Fast concurrent HashMap for Rust
by asdf-asdf-asdf on Friday March 27, 2020 @05:54AM
(#22701526)
sorry, what does "to optimize the balance of safety and speed with as few compromises as possible" mean? it's possible to cover many-many situations with that description.
In particular, the implementation of data structures. Raw memory allocation, usage of pointers, low level concurrency primitives - none of that can be done without the programmer manually enforcing invariants.
But unsafe isn't wanton abandon. You still have to obey the type system and ownership rules.
As for the goal, it depends on the author. Some prioritize one over the other. In general the Rust community these days tries to optimize the balance of safety and speed with as few compromises as possible - which is fundamentally why the language exists.