←back to thread

193 points ingve | 1 comments | | HN request time: 0s | source
Show context
ilrwbwrkhv ◴[] No.43712785[source]
Rust has a bunch of these while being maintainable.
replies(4): >>43713075 #>>43714151 #>>43714332 #>>43724210 #
mrkeen ◴[] No.43714151[source]
STM is Haskell's feature for safe shared&mutable state.

What is Rust's feature for safe shared&mutable state?

replies(2): >>43715359 #>>43715749 #
speed_spread ◴[] No.43715359[source]
That would be Arc<Mutex<T>>, which works but is no STM.
replies(1): >>43715788 #
1. Philpax ◴[] No.43715788{3}[source]
Additionally, the actor model is pretty easy to implement: https://ryhl.io/blog/actors-with-tokio/