Live data from Hacker News

Java 20 / JDK 20: General Availability

mail.openjdk.org

1–10 of 356 posts

Re: Java 20 / JDK 20: General Availability

#2
Gist: ``` JDK 20 introduces six features: - Scoped values for safe sharing of data across threads - Record patterns for declarative data navigation and processing - Foreign function and memory API for interoperation with code and data outside the Java runtime - Virtual threads for lightweight concurrent programming - Structured concurrency for simplified multithreaded programming - Pattern matching for switch statements and expressions for concise and safe complex data-oriented queries ```

Re: Java 20 / JDK 20: General Availability

#6

Note all the new cool stuff is incubator and preview status and I'm a little worried that this will still be the case for the JDK 21 stable release.

IIRC they are going to release pattern matching for switch and record deconstruction as stable in JDK 21.

Re: Java 20 / JDK 20: General Availability

#8

Note all the new cool stuff is incubator and preview status and I'm a little worried that this will still be the case for the JDK 21 stable release.

I think this is supposed to be the last preview version of FFI and the other JEPs from Project Panama, so hopefully we will have them at least but I definitely share a bit of that concern.

Re: Java 20 / JDK 20: General Availability

#10
This is exciting, can't wait for the LTS release next year... that said, I don't much care for the "case SomeType t when ..." pattern matching syntax, I don't see the benefit of introducing a new keyword over using "if"... or even just "&&". To pinch the example used in[1]:

    case Tuner t && guitar.isInTune() -> ...;
and

    case Tuner t if guitar.isInTune() -> ...;
both seem as clear as

    case Tuner t when guitar.isInTune() -> ...;

...am I misunderstanding the reasoning here? Is it being introduced to keep the grammar definition simpler?

1: https://foojay.io/today/its-java-20-release-day-heres-whats-...

Post reply on HN