4 ms·
> I got an early look at Java, with concurrency built in from the start, [...] and I "knew" it was going to be huge. And Java doesn't even have good (conceptua
by eru 3y ago
> I got an early look at Java, with concurrency built in from the start, [...] and I "knew" it was going to be huge.
And Java doesn't even have good (conceptual) support for concurrency. Compared with eg Erlang, Rust or even Haskell.
But Java was still better at it than C or C++ at the time.
- dboreham 3y agoIn your opinion. Some of us believe the exact opposite.
- soulbadguy 3y agoThere are a lot of good things about java (and the jvm by some extend), but good concurency is not one of them.
- bitcharmer 3y agoThis is not true. JSR-133 was one of the first and most prominent implementation of memory model among general purpose languages. You don't seem to know enough about the platform and it's history to make definite statements like that, imo.
- grumpyprole 3y agoJSR-133 was quite a few years after Java's release. But even after these changes, many problems remained. For example, standard library classes were often not thread safe out-of-the-box, even something seemingly innocuous like a date formatter class would malfunction in a threaded context. The rules around thread safety were also very complex, especially with regard to constructing objects. IMHO, it did not compare well with other languages around the same time built with concurrency in mind, for example Erlang. I was once very fortunate to meet Joe Armstrong and we briefly discussed Java, suffice to say he was not impressed by it.
- soulbadguy 3y ago+1
- eru 3y agoBy exact opposite you mean that when Java just came out ('I got an early look at Java, [...]') had good concurrency support? One can make a solid argument that modern Java is adequate. But I don't buy you believe that of early Java?
- ungamedplayer 3y agoOld mate isn't alone.
- pseudocomposer 3y agoI 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.
- almostnormal 3y ago> But Java was still better at it than C or C++ at the time. That's not even a contest. Java was released in 1995. At that time C did not have any kind of support for concurrency, all solutions were platform dependend and not part of the language.