5 ms·
> better designed than Scala How so? Do you mean Java in general, or just the pattern matching part? Can you provide an example where Java is "better designed"
by ebruchez 6y ago
> better designed than Scala
How so? Do you mean Java in general, or just the pattern matching part? Can you provide an example where Java is "better designed"?
- gher-shyu3i 6y agoDestructuring in Scala is allocation heavy, I expect it to be much lighter weight in Java.
- RoyBro 6y agoScala compiles to java bytecode. Scala can only be faster then Java, in that Scala can leverage all functionality of the JVM and on top provide extra smarts that Java cannot due to backwards compatibilty it has to offer.
- gher-shyu3i 6y agoThis has never been true for non-native languages (Scala, Clojure, Kotlin, etc.) as far as I'm aware. They've always been slower. The JVM is designed with Java in mind and co-evolves with it.
- tormeh 6y agoOne of the benefits of Scala's willingness to break bytecode compatibility all the time is that whenever Java/JVM implements a Scala concept, Scala switches to the Java method under the hood. Whenever the JVM gets Java-specific optimisations, Scala will use those. That's honestly pretty cool.
- fulafel 6y agoThey have in practice been slower because they try to be higher level, more ergonomic languages than Java. There aren't many performance-first JVM languages yet I think (Fortress maybe? They cited JVM problems when they wrapped up though).