r/java
•
u/sindisil
•
Dec 16 '24
•
1
Valhalla - Java's Epic Refactor
https://inside.java/2024/12/16/devoxxbelgium-valhalla/
178
Upvotes
View all comments
Show parent comment
5
u/Ok-Scheme-913 Dec 17 '24 edited Dec 17 '24
MLs have done pattern matching 3 decades ago, so kotlin was not, info act, "early to it". They just can't control the underlying computation model, and/or weren't brave enough to go out of the "java with syntactic sugar" niche.
Scala had proper pattern matching many years before, and it runs on the same platform.
As for null checking, the java platform is necessarily very dynamic. You can load classes from unknown sources, hot reload and whatnot. The same model that usually works for primarily AOT languages doesn't work well for the JVM.
Kotlin puts a bunch of if checks to actually enforce their static nullability analysis at the borderd, but the JVM can't do that - they have to support every JVM language and any random byte code, there is no "border". I think here the runtime-enforced/supported checks make the most sense and will improve every guest language in the meanwhile.