I just hear and see people saying scala is designed for MultiThread though it's actually for general purpose.
And it claims "The thing is that while you can make classes thread-safe in Java (if you know what you're doing ), Scala makes it easy and natural to do."
And indeed AKKA and Lift is written in scala.(actually java and scala)
But java also did improves in this aspect with the new package of java.util.concurrent. So why didn't AKKA and Lift born in JAVA?
Maybe you will say scala makes java looks like C. :-)
I know the fact that it is possible to mix JAVA and scala. Scala is able to call seamlessly into Java code. So what java have,so does scala.
Only some design like Actors/Agents or something else? (note Actors/Agents are cannot solve all the problem in MultiThread.)
I heard some news that scala is going to be able to adopt XText. To be able to leverage XText to write thread logic, not sure if this is true or not.
UPDATE
EDIT
Related:
What advantages does Scala have over Java for concurrent programming?
Java Concurrency: CAS vs Locking
Difference in MultiThread aspect between Java and C/C++
Pitfalls/Disadvantages of Functional Programming
Actually I am very interested in some one can answer this question in some brand new angle which could enlighten my mind , provide some idea unknown before.
But it's closed due to not constructiveness. :-)
I am not really an expert in this, but Scala is a (partly at least) a functional programming language while Java is not (it is imperative). One feature of functional programming is that it avoids (in a 'natural' way) side-effects.
Thread-safety on the other hand is pretty much about avoiding side-effects (i.e. different threads modifying same objects/parts of memory/other resources at the same time).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With