2 ms·
I think talking about how ARC is implemented in Rust is cool. I would just pitch it differently. I think what I don't like about your current description is t
by samth 13y ago
I think talking about how ARC is implemented in Rust is cool. I would just pitch it differently.
I think what I don't like about your current description is that it makes it seem like unsafety is what allows you to _have_ Arc in the language. Instead, unsafe blocks are what allow you to _implement_ Arc inside the language.
I'd start the footnote this way:
---------------
A footnote: Implementing Arc
So, the Rust language doesn't let us use shared mutable state in dangerous ways, but what happens if we really need to get down and dirty? For example, what if we wanted to _implement_ `Arc` ourselves?
In fact, `Arc` and `RWArc` are both implemented in Rust. Inside their implementations, they use locks, low-level memory operations, and everything else you might see in a C++ program. However, anytime we use these features, we have to wrap them in an `unsafe` block.
...
---------------
I hope that conveys the different emphasis that I'm talking about.
- steveklabnik 13y agoCertainly. Thanks. That's much more clear.