4 ms·
This is nonsense. Anyone who understands how to write actually correct C can immediately write identical code in unsafe rust, avoiding any use of references. Wr
by puffoflogic 5y ago
This is nonsense. Anyone who understands how to write actually correct C can immediately write identical code in unsafe rust, avoiding any use of references. Writing the code at the safety boundary is the only thing that even requires rust-specific knowledge; but contra FUD, there is a [very] conservative but explicit list of soundness requirements right in the documentation.
You only get in trouble if you want to argue with the conservativeness of the basic requirements, and then you're off into as-yet-undefined territory of stacked borrows. But it's absolutely unnecessary to understand this to write correct safety boundary code, it just might not be the maximally elegant, simple thing a language lawyer could have written.
- Comevius 5y agoMaybe not a hell of a grasp then, just more grasp than I have. It's easy to get lost in fighting the language when creating a safe interface on top of unsafe with very fine-grained control over memory.