4 ms·
I agree that Rust handles concurrency about as well as Java (in addition to its memory safety). But could you provide docs on Erlang or Haskell concurrent data
by pseudocomposer 3y ago
I agree that Rust handles concurrency about as well as Java (in addition to its memory safety). But could you provide docs on Erlang or Haskell concurrent data structures that were better than Java’s, say, 10-20 years ago? Java’s support for concurrent data structures was pretty unprecedented in its heyday.
- quickthrower2 3y agoSTM, 2006? https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.67.3686&rep=rep1&type=pdf https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.67... Still way after Java was released I guess
- grumpyprole 3y agoJava didn't initially ship with lock-free data structures, those came later thanks to Doug Lea.
- seanhunter 3y agoThe best example of this is probably the “Beautiful Concurrency” paper from Simon Peyton-Jones in 2007 https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/beautiful.pdf?from=https://research.microsoft.com/en-us/um/people/simonpj/Papers/stm/beautiful.pdf&type=exact https://www.microsoft.com/en-us/research/wp-content/uploads/...
- SkiFire13 3y agoCompared to those other languages, Java has no mechanism to enfore the use of concurrent data structures, it's entirely up to the programmer to use them.
- grumpyprole 3y agoJava still doesn't provide persistent data structures out-of-the-box. IMHO these are more important than lock-free mutable data structures. When one really does need shared mutable state, Haskell supports transactional updates to mutable state (STM), with optimistic locking and rollbacks. It's awesome, but unfortunately just not practically possible in any language with rampant untracked side-effects.
- Arch-TK 3y agoErlang processes are a first class object. Data is immutable. There's a special syntax for sending and receiving messages between processes. I would say that in some ways this is simply incomparable to java but I think this concurrency model is probably the easiest and simplest to work with of any concurrency model. There are obviously drawbacks like with anything but for a lot of situations it's an excellent choice.