haskellclojurestmlanguage-comparisonstransactional-memory

How does Clojure STM differ from Haskell STM?


I am trying to find the differences between what Clojure calls an STM and what is implemented in Haskell as STM. Taking the actual language semantic differences aside I am a little confused as Rich Hickey says in his speech that Clojure's implementation of STM is very different from anything else out there, but I don't understand the differences apart from the language choice.


Solution

  • Clojure STM has 3 big unique features:

    1. Implements MVCC snapshot avoiding transactions restarts on read invalidation.
    2. Ensures references on read-writes provides a kind of manual control over resource acquisition order.
    3. Has explicit commute which reduces retries on commutative writes.