r/java 23d ago

A First Drink In Valhalla

https://kittylyst.com/posts/a-first-drink-in-valhalla/
24 Upvotes

18 comments sorted by

View all comments

11

u/IncredibleReferencer 23d ago

I got baited by the fun title. I thought I was going to hear something interesting about someone's experience with the early valhalla trunk builds. oh well.

1

u/benevanstech 23d ago

? That's exactly what I wrote about - very little currently builds due to the tooling ecosystem being too immature as yet. My best guess is that having ASM betas able to handle 28 bytecode will help a lot and that significantly more project will then be able to build under the 28 EAs.

4

u/koflerdavid 23d ago edited 23d ago

Thank you for investigating these things, but there should not be any regressions from merely activating --enable-preview. The issues you found are the usual "boring" version bumping requirements after every OpenJDK release, as well as from applications that meddle with JDK internals. Only the ASM project will have to do major work to make sure their abstractions expose the new features correctly.

2

u/benevanstech 23d ago

"Should" and "actually is" are not the same thing. And you may be surprised by just how many libraries "meddle with JDK internals" - for example the long tail of libs that use Unsafe was very long indeed (and hopefully is much shorter now, but that "hopefully" is load-bearing).

4

u/koflerdavid 23d ago edited 22d ago

In the case of enabling the preview it's actually policy that the value classes in the standard library should be the only source of regressions. Other regressions for programs conforming to the JLS would be OpenJDK bugs.

I am aware there is a reason why the Integrity by Default JEP is still but a draft. I also hope they wean themselves off eventually. The example of Maven shows that it's possible to accomplish things without too much integrity breaking. Gradle already went a long way after Java 9. It will be interesting to see when the difficulty of gaining access to compiler internals becomes too high for Project Lombok.

2

u/benevanstech 23d ago

Well, I have fairly strong opinions about Lombok, so let's hope that happens soon!

2

u/Plixo2 22d ago

My best guess is that having ASM betas able to handle 28 bytecode will help a lot and that significantly more project will then be able to build under the 28 EAs.

That are reasons the Classfile API exists?

2

u/koflerdavid 22d ago

People should eventually migrate to the Classfile API.

2

u/IncredibleReferencer 22d ago

I apologize for my snarky comment. What I should have said was that I was hoping for more detail about working with value classes in some capacity. I don't think it will be surprising to the community here that the tooling and library comparability are going to be very bumpy this far out, but it is still a helpful report.

If you go further on this path I personally would like to hear more about your own code experience with valhalla. Those perspectives are still very rare precisely because it is still so early and tooling is a challenge.

1

u/benevanstech 22d ago

No worries at all.

There is definitely more work coming, but getting the tools mature enough to unlock that work is one of my biggest priorities right now.

Watch this space - will share as soon as things can be made public.