🥹 Java 23 — Devs Frustrated Waiting For The Vector API
Java 23 will come with eight preview of the Vector API. The buglist is still long, and developers loose nerves
The 23 release of Java is not published yet. But the list of features is already being updated.
So far we know about three previews and two incubations that will land in that release.
Incubations are features offered in separate modules. Previews are almost ready features.
The three previews are:
- primitive type pattern matching
- parser, transformer and generator of Java classes
- stream gatherers
1. Primitive Type Pattern Matching — Preview
So far pattern matching handled mostly classes. What is great, but it triggered immediately a question why on Earth, why, it doesn’t support primitives.
It applies to switch statement, if statements and also instanceof.
Here’s an example:
if (getPopulation() instanceof float pop) {
... pop ...
}
What happens here is that we call a function getPopulation, then we check if the result is an instance…