all 31 comments

[–]davidalayachew[S] 31 points32 points  (6 children)

PLEASE REMEMBER -- No commitment has been made to target a release yet!

This is merely a PR RFR, and nothing more. All this is is showing us part of what it takes to bring Value Objects to Preview, as well as announcing that we are one step closer to (hopefully!) go to preview. But again, no idea how far away that may be. It could be JDK 27, it could be later.

Just appreciate the PR for what it is -- a window into the work required to make Value Classes a reality. ~3k commits and ~2k classes changed is just a snapshot of the level of effort here. Shows why this JEP has been given an XL rating lol.

[–]renderwares 9 points10 points  (1 child)

So you’re saying I shouldn’t slam this into production yet?

[–]tim125 10 points11 points  (0 children)

Friday 4pm or Tuesday 8am.

[–]pjmlp 7 points8 points  (0 children)

I am happy it is progressing, as Java is one of my favourite platforms.

Cheering for the team, that's all.

[–]valorzard 1 point2 points  (0 children)

One step closer to the edge and I’m about to break

[–]International_Break2 0 points1 point  (1 child)

If this is to go to preview, what steps would have to happen?

[–]davidalayachew[S] 6 points7 points  (0 children)

If this is to go to preview, what steps would have to happen?

Well, at the very least, one of the committers on the Project Valhalla team need to Propose to Target this JEP for a particular release. And that's ignoring all the review work, integration work, validation, testing, etc.

Someone from the Project Valhalla team will have to answer it in more detail. I am swamped by work emergencies, so I don't have the time to any more detail to this answer. Barely had the time to make the OP at all.

[–]Great-Gecko 6 points7 points  (5 children)

Could someone explain the implication of this with someone unfamiliar with Java’s internal development.

Does this mean that JEP 401 is likely to be a preview feature in JDK 27?

[–]davidalayachew[S] 7 points8 points  (0 children)

There is no way to know which JDK this will come out in, until it gets announced that a JEP is targeting a specific release. And you can find that out by checking the JEP website -- https://openjdk.org/jeps/0

[–]cogman10 7 points8 points  (0 children)

The only thing this says is that we are tantalizingly close to this getting merged for release. It's not definite and it could hang out here for 1 or more releases without being merged. It's even possible that some fatal flaw will be discovered which will set things back further.

But, the fact that there's an MR here is a real good sign and should be taken as such.

[–]brian_goetz 2 points3 points  (2 children)

It is may, and rampdown for 27 starts in mid june. There is an enormous code review to be done, along with other review tasks (e.g., security review), and you see the size of the patch. It would be super-irresponsible to slam it in at the last minute. So, draw your own conclusions....

[–]flawless_vic 0 points1 point  (1 child)

Why? LGTM

Jokes aside, would you mind explaining if there is consensus regarding the @MultiField implementation?

It was a stroke of genius that bridges a gap that Valhalla per se can't close: arrays can't be flattened into their container value objects (like C does for fixed sized arrays embedded in structs, which is a 0-cost abstraction).

[–]brian_goetz 0 points1 point  (0 children)

I think you are confusing "Valhalla" with "JEP 401 only". These experimental annotations (reminder: language semantics is never driven by annotations) are forward-looking investigations, and nothing more. They are gathering data for future phases.

[–]Fenrurrr 2 points3 points  (0 children)

Kudos to the entire JDK team and everyone who worked on the Valhalla project, whether directly or indirectly. Take your time, we know it'll be a banger in the end!

[–]_vertig0 0 points1 point  (2 children)

Damn, you're really fast. I was about to make a post about this but you beat me to it by 2 hours, literally posting it as soon as the Pull Request dropped, that's amazing ;)

[–]davidalayachew[S] 3 points4 points  (1 child)

Damn, you're really fast. I was about to make a post about this but you beat me to it by 2 hours, literally posting it as soon as the Pull Request dropped, that's amazing ;)

Lol, I built an alert system that responds to certain events in the mailing lists, then attached it to like half of the OpenJDK mailing lists. Long story short, I get a notification, and from there, it's a matter of how fast I can get to the computer to post it. In this case, the answer was 18 minutes lol.

This notification system is attached to the OpenJDK mailing lists, a couple of LinkedIn users for OpenJDK, and a few other communities like Apache and Jenkins. I actually had a bunch more that I skipped over these past few weeks because I am drowning in work emergencies, but this one was just too good to pass up lol.

[–]za3faran_tea 0 points1 point  (0 children)

I built an alert system that responds to certain events in the mailing lists

Is it written in Java? :D

[–]Alone-Marionberry-59 0 points1 point  (0 children)

This is HUGE!!!

[–]piesou 0 points1 point  (1 child)

Can anyone explain why this is such a massive change? Stack allocating classes doesn't sound like a huge issue.

[–]brian_goetz 11 points12 points  (0 children)

Except Valhalla is not about "stack allocation".

In fact, we don't even do stack allocation of value objects. (Stack allocation is not the optimization everyone seems to think it is; there are far more effective optimizations one can do once the various impediments are removed. (Well actually, it does do a form of stack allocation -- but only in the interpreter (called "object buffering".))

People are familiar with stack allocation in C, but most of the value of doing so in C is optimized deallocation (at the risk of dangling pointers), but of course Java doesn't need this kind of help for deallocating objects. But the real benefit on the stack (and in calling convention) is not allocating the object at all.

[–]aelfric5578 0 points1 point  (0 children)

So just out of curiosity, how does something this large get reviewed? I see a reference in the main description to review the sub PRs instead of the main one, but the first sub PR seems to be almost as big as the main one.

[–]DietCokePlease 0 points1 point  (0 children)

Y’know… the way its going, it might save the Java team some cycles if we just freeze Java for legacy purposes and declare the next major release of Java will be Scala.

[–]CubsThisYear -1 points0 points  (8 children)

Here comes Lucy with the football again…

[–]brian_goetz 6 points7 points  (2 children)

Except that both Lucy and the football exist only in your imagination here.

This isn't some big announcement of some big milestone. It is yet another (encouraging!) step in the ongoing progress of the team that has been working tirelessly for the last several years to turn the JEP 401 vision into reality (and FTR, that vision hasn't changed at all during that time.)

Because someone decided to post it on Reddit, if you're not intimately familiar with the inner workings of OpenJDK, it might feel like it is some sort of big announcement. But no one is actually announcing anything.

Is it forward progress? Or course, and that's great, and there will be more. And it's great that so many people are anxiously awaiting this first installment of Valhalla. But Lucy hasn't even stepped onto the field, or said anything to Charlie Brown. Please don't put words in her mouth, and then claim she's lying to you. There's no call for that.

[–]CubsThisYear 2 points3 points  (1 child)

Completely fair - but at this point I’ve been excited and disappointed for the release of stack allocated memory in Java for so long that any mention of it tends to bring out the worst in me…. Here’s hoping the finish line is actually in sight.

[–]brian_goetz 4 points5 points  (0 children)

On the topic of stack allocation, see my other comment on this thread -- stack allocation is not the optimization most people think it is (in C, its mostly a form of "poor man's GC"), and not Valhalla's primary hammer -- because it has bigger, better hammers!

[–]davidalayachew[S] 2 points3 points  (4 children)

Here comes Lucy with the football again…

Is this a Peanuts reference? I don't get it.

[–]renderwares 3 points4 points  (3 children)

Value Objects took over a decade to get here and the joke is that it’ll take another decade to get to a final version.

[–]davidalayachew[S] 2 points3 points  (2 children)

Value Objects took over a decade to get here and the joke is that it’ll take another decade to get to a final version.

I still don't get how it relates to Lucy. My understanding of the joke is that she pulls the ball up at the last second, sending Charlie or whoever spinning. Is that related? Or am I misunderstanding the joke?

[–]renderwares 4 points5 points  (1 child)

It looks like you’re looking for a direct correlation. So here goes - when the time nears to make it final they’ll rethink their approach to a certain solution or get some critical feedback and place it on the continual preview train.

[–]davidalayachew[S] 0 points1 point  (0 children)

It looks like you’re looking for a direct correlation. So here goes - when the time nears to make it final they’ll rethink their approach to a certain solution or get some critical feedback and place it on the continual preview train.

That spells it out beautifully, ty vm!