News for hackers. Stuff that matters.
Re:OpenJDK mailing list: Null-safety and value types by saagarjha on Tuesday February 07, 2023 @06:36PM (#34701595)
> In this case they're realizing that NULL makes optimization difficult

How so? Null checks are mostly “free” on the JVM, they trap on the zero page and get converted to an exception via a signal handler.

Re:OpenJDK mailing list: Null-safety and value types by Someone on Tuesday February 07, 2023 @06:50PM (#34701744)
It’s not only the checks, but allotted storage. An Integer that’s guaranteed not to be null can be stored in 4 bytes, a “Point” class with two “int” fields that is guaranteed to be not null can be loaded in a 64-bit register, etc. That makes it easier for the compiler to generate good code.
Re:OpenJDK mailing list: Null-safety and value types by pjmlp on Wednesday February 08, 2023 @04:45AM (#34706105)
Eiffel was already doing this with expanded classes and non void references, but yeah, who would have thought such details are relevant. :)