Amber, Galahad, Leyden.
Lilliput, Loom, Panama, and Valhalla.

What happened in these #OpenJDK projects in 2022 and what will be worked on in 2023? And why am I such a fanboy? 🏟️🚩 A thread. 🧡

(If you prefer video, check the latest Inside #Java Newscast: https://www.youtube.com/watch?v=-sfB40FHfJE)

----

Preamble:

What I write about 2023 are my personal guesses. Anything and everything can change or disappear, so don't rely on any of this.

"Prediction is very difficult, especially if it's about the future!"

Java's Plans for 2023 - Inside Java Newscast #40

YouTube

Project Amber
"explore and incubate incubate smaller, productivity-oriented Java language features"

In 2022:
* preview of record patterns https://openjdk.java.net/jeps/432
* progress on patterns in switch https://openjdk.java.net/jeps/432

JEP 432: Record Patterns (Second Preview)

In 2023:

Amber is brimming with ideas! Some mature, some πŸ₯§in☁️ - in that order (by my estimate):

* string templates https://openjdk.org/jeps/430
* unnamed pattern/variable `_`
* primitive types in patterns
* statements before `super()` https://mail.openjdk.org/pipermail/amber-dev/2022-October/007537.html
* imperative destructuring
* simpler `main()` https://openjdk.org/projects/amber/design-notes/on-ramp
* "withers" for records

(I'm hoping for progress - but not necessarily JEPs - on most of these.)

Just look at this list! How could I not be an Amber fanboy?! 🚩🚩🚩

JEP 430: String Templates (Preview)

Project Galahad
"contribute Java-related #GraalVM technologies to the OpenJDK Community and prepare them for possible incubation in a JDK main-line release"

No project, yet (has been proposed in Dec https://mail.openjdk.org/pipermail/discuss/2022-December/006164.html), so don't expect anything tangible in 2023 but πŸ‘€ it.

Call for Discussion: New Project: Galahad

Project Leyden
"improve the startup time, time to peak performance, and footprint of Java programs"

2022 saw a call to action (https://openjdk.org/projects/leyden/notes/01-beginnings) and a very interesting white paper (https://openjdk.org/projects/leyden/notes/02-shift-and-constrain) by @mreinhold. Expect discussions but nothing tangible in 2023.

Project Leyden: Beginnings

Project Lilliput
"explore techniques to downsize Java object headers in the Hotspot JVM from 128 bits to 64 bits or less"

In 2022:
* achieved 64-bit headers https://mail.openjdk.org/pipermail/lilliput-dev/2022-May/000457.html
* published #JDK17 fork with that https://github.com/openjdk/lilliput-jdk17u

In 2023:
* work towards merge of 64-bit headers into JDK main line
* work towards 32-bit headers

In the meantime, you can find out Lilliput's impact on your codebase with JOL: https://github.com/openjdk/jol

@shipilev gave some numbers on 🐦: https://twitter.com/shipilev/status/1615095410569232384

Milestone 1

Project Loom
"support easy-to-use, high-throughput lightweight concurrency"

In 2022:
* previewed virtual threads
* incubated structured concurrency and scoped values

Watch @JosePaumard's video on scoped values: https://www.youtube.com/watch?v=fjvGzBFmyhM

In 2023:
* work towards finalization of these features (I see a chance for finalized virtual threads in #Java21 but not for the APIs)
* work towards synchronization and file I/O (on Linux, with io_uring) no longer pinning virtual threads to carrier threads

Java 20 - From ThreadLocal to ScopedValue with Loom Full Tutorial

YouTube

Project Panama
"improve and enrich the connections between the JVM and well-defined but 'foreign' (non-Java) APIs"

In 2022:
* progressed on vector API
* previewed foreign function and memory (FFM) APIs
* made jextract independent

In 2023:

* gather more feedback on to get timely and safe deallocation absolutely right
* work towards more linker options, e.g. to pass heap segments to native calls
* improve jextract, e.g. support for capturing errno

A finalization in #Java21 is possible.

Project Valhalla
"augment the Java object model with value objects and user-defined primitives, combining the abstractions of OOP with the performance characteristics of primitives"

In 2022:
* consolidated features in fork
* published early access build https://jdk.java.net/valhalla/

In 2023:
* gather feedback from EA build
* reconsider how primitive types are surfaced in the language
* maybe rework JEP 401 https://openjdk.org/jeps/401 based on that

Valhalla Early-Access Builds

🏁

Any one of these projects is already impressive - that #OpenJDK runs seven❗ of that magnitude concurrently is amazing and I can't wait to see what 2023 will bring!

I'll cover all developments in future Inside Java Newscasts (sub https://youtube.com/java?sub_confirmation=1) and here on Twitter.

If you liked this thread, you can do me a favor and share it with your followers - DevRel people get paid by retweets and #WinterIsComing. πŸ˜‰

https://mastodon.social/@nipafx/109716542056210959

Oh, and if I forgot to mention a project, technology, or detail and you want to know more, just ask below. I'll do my best to answer.
@nipafx statements before super() are such a nice capability to move into the language proper! Code executing before super()/this() already works on the JVM level as arguments passed to them can contain arbitrarily complex expressions and they're evaluated before the call itself. This now essentially allows similar code to not mandatorily retain all its results on the operand stack as an argument to super(), but it can instead either POP or *STORE some. I like this idea a lot.
@attilasz Absolutely, it will clean up a number of complicated constructors and avoid a bit of recomputation here and there. But I wonder how error-prone it will be. Let's hope the compiler warnings can do a good job keeping us from letting uninitialized `this` escape.
@nipafx Waiting patiently for instanceof pattern matching in switch! This will be soo great

@siedlerchr

"How many reviews can a feature go through?"

Patterns in switch: "Yes!"

😬

@nipafx Yeah I hoped it would be already out of preview now..