Rust might have brought many interesting concepts into mainstream, however unsafe wasn't one of them.
Rust might have brought many interesting concepts into mainstream, however unsafe wasn't one of them.
It is like arguing Rust invented affine types while ignoring the ideas in Cyclone and linear typing, even if they don't map 1:1 to what Rust has.
Concurrent Haskell doesn't use typeclasses to constrain what data can be passed between threads. All data can be in Concurrent Haskell because all data is immutable anyway. It's a fundamentally different concept, not a slightly different subset like affine/linear types.
I miss working with him, but there are lots of folks involved with Swift who think really deeply about this stuff. No complex feature is the work of any one person in isolation.
Sendable is just yet another monadic type, or a ML functor.
http://cml.cs.uchicago.edu/pages/sync-var.html
As for the rest I am on the go to type a proper example.
The purpose of the ST Monad is to prevent you form sharing the object inside it wrapped by an STRef with another thread of execution.
IORef utilizes the uniqueness of the ``IO`` monad and its properties guaranteed by the haskell runtime i.e. only one thread can use it at any given time to prevent more than one thread from having a reference to the object inside the IORef from multiple.
[1]:https://www.microsoft.com/en-us/research/wp-content/uploads/...