logoalt Hacker News

arein3yesterday at 1:38 PM6 repliesview on HN

Project Valhalla will go into Java 28 (next year, and preview version).

Fingers crossed I'll manage to use null type safety in my lifetime.


Replies

pregnenoloneyesterday at 2:17 PM

> Project Valhalla will go into Java 28

Unfortunatley without specialized generics and without the performance benefits that are supposed to come with it. They were too slow with Valhalla.

rf15yesterday at 1:43 PM

universal null type safety has sadly been discarded as a core concept of Valhalla in my Understanding; that being said, the proposals in Valhalla have null-safety as a side effect, but only under certain conditions.

show 2 replies
retrodaredevilyesterday at 4:22 PM

NullAway with JSpecify annotations are a really good way to add null safety to Java applications. Even enforces nullability at the generic level.

show 1 reply
brabelyesterday at 3:32 PM

You really need to dare to try something else, Kotlin has been available for many years and the cost for a Java shop is super small since the same tools work with both. I’ve used also Dart which is lots of fun. Even Typescript can be a good alternative depending on what you’re doing. All have nullability guarantees and a nicer type system than Java while being in the same ballpark in terms of performance.

karussellyesterday at 1:42 PM

A first step of Valhalla that is ...