2

Java 19 could be big

 2 years ago
source link: https://www.infoworld.com/article/3652336/java-19-could-be-big.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Java 19 could be big

The next version of standard Java seems poised to include a foreign function and memory API, a vector API, pattern matching for switch expressions, universal generics, and more.

By Paul Krill

Editor at Large,

InfoWorld | Mar 8, 2022 3:00 am PST

With Java 18 due as a production release in two weeks, Java 19 is beginning to take shape. The next release of standard Java is set to move forward with an API to interoperate with code outside the Java runtime, the first of many potential proposals that could cover capabilities ranging from universal generics to a RISC-V port.

The Java 19 proposal now floating in the OpenJDK community is a foreign function and memory API, which would allow Java programs to interoperate with code and data outside of the Java runtime. The feature will be previewed in Java Development Kit (JDK) 19, which is expected to arrive this September.

[ Also on InfoWorld: JDK 18: What’s new in Java 18 ]

Identified as JEP (JDK Enhancement Proposal) 424, the foreign function and memory API would invoke code outside the JVM by accessing foreign memory. This API was featured in an incubator stage in JDK 17 and will be re-incubated in JDK 18, which is scheduled to ship on March 22. For JDK 19, the API would move to a preview stage, incorporating refinements based on feedback. JDK 19 will be a short-term release of Java supported for just six months.

Another possibility for inclusion in JDK 19 is a vector API, which is being incubated for a third time in JDK 18. A fourth incubation has been proposed. This API would express vector computations that compile at runtime to optimal vector instructions. Pattern matching for switch expressions and statements, which is undergoing a second preview in JDK 18, is another possibility.

Green IT: The color of money
0 seconds of 21 minutes, 50 secondsVolume 0%

Overall, Java this year is slated to continue the evolution of four initiatives, Oracle said. These include Project Valhalla, to incubate advanced JVM and language features; Project Panama, to interconnect native and JVM code; Project Loom, to improve concurrency; and Project Amber, to explore and incubate smaller, productivity-oriented Java language features.

The following features, which are the subject of JEPs or draft JEPs not now targeted to a specific version of Java, could very well find their way into Java 19:

  • A preview of universal generics, from Valhalla. Delivered through three JEPs, universal generics would unify the treatment of reference and primitive types in generic code by allowing Java type variables to range over both kinds of types.
  • A preview of value objects, also an enhancement from Valhalla, providing class instances that have only final instance fields and lack object identity. Identity-free value classes would be declared.
  • A preview of record patterns, to deconstruct record values. This is part of Project Amber.
  • Region pinning for the G1 garbage collector, to reduce latency by implementing region pinning to G1 so garbage collection does not need to be disabled during JNI (Java Native Interface) critical regions.
  • A Linux port of the JDK for RISC-V, an open source, royalty-free instruction set architecture.

Some of these features, if they do not end up in JDK 19, might end up in a subsequent release such as JDK 20, which would arrive in March 2023, based on standard Java’s six-month release cadence. Others might slip to an even later release or perhaps never make the cut to be in Java at all.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK