3 ms·
The problem of Scala is that it is outclassed by Rust and Kotlin at its two niches of, respectively, "best designed programming language" and "better Java on th
by devit 7y ago
The problem of Scala is that it is outclassed by Rust and Kotlin at its two niches of, respectively, "best designed programming language" and "better Java on the JVM".
Scala can't beat Rust because you can't have safe concurrency (and also single-threaded mutation control) without linear types, and you can't have linear types on the JVM; furthermore, a GC and VM-based language is inferior to a native non-GC one providing the same guarantees.
Scala can't beat Kotlin because Kotlin is designed to be just a better Java and Scala also tries to do other things that reduce Java compatibility; pivoting would result in being behind Kotlin with no hope of catching up.
Furthermore, its core features are cute but fundamentally broken: class inheritance is an anti-pattern and functional features need either purity like Haskell or mutability control like Rust to work safely and efficiently; on top of that, the language is also complicated and hard to learn.
- bmc7505 7y ago> you can't have linear types on the JVM Why can't you have linear types on the JVM?
- MrBuddyCasino 7y agoI don't get it either - its a compiler construct, not a runtime check (remember Rust's "zero overhead" motto).
- deleted 7y ago[deleted]
- pkolaczk 7y agoScala and Rust are not competitors. They solve different problems and are designed for different kind of software. Rust will never be in the same league of productivity / abstraction as Scala is. There is a huge mental overhead of manual memory management that the language forces on you everywhere. Try to write a lockless or immutable Hashmap in Rust and then in Scala to see the difference. Or a graph-like structure. Or async code. Just compare method signatures. Scala is a piece of cake compared to Rust in this area. On the flip side, Scala will never be as good system language as Rust is, even after adding more improvements to the JVM e.g. value types, or even with Scala native. In these use cases where I need a tight control of resources I'd take Rust over Scala every time. As for Kotlin - meh, it is just Java with nicer syntax, not interesting to me at all.