← Back to context

Comment by mrkeen

10 hours ago

All of the "my non-Haskell language does this" comments in the thread are the same (with maybe a Rust exception).

The "lock" instruction is what the article is telling you to ditch.

> If the programmer forgets to lock the mutex the system won't stop them from accessing the data anyways

If the programmer forgets to "lock"

> and even then there's no actual link between the data being locked and the lock itself

lock (thing) { return thing.contents // shared, mutable array given out freely to the world }

'contents' has no notion that it has anything to do with this "lock"ing thing.

OK, seems my english was not enough to see the point. after reading this clear explantation is have to agree with you 100%