Live data from Hacker News

JEP 401: Value Objects (Preview) merged to OpenJDK master

github.com

121–130 of 185 posts

Re: JEP 401: Value Objects (Preview) merged to OpenJDK master

#121
post #15

I feel lonely in that: I mostly love Java as a language. The lack of value types is the biggest impediment to certain types of performance. I am really looking forward to this evolution of the language.

java the language is amazing the problem with it is entirely cultural. why is `IStatusChangeEntityCreationManagerFactory` everywhere? and why are the frameworks so huge and all encompassing? i think batteries included rails-style frameworks are great, but when i wrote Java, it didn't feel like rails at all none of these are language problems

I have an opinion on why. If you were in that world 25+ years ago, you'll be familiar with the landscape. There were a dozen popular application servers, each with 15 versions in the wild, all running on premises, and you had to ship software to customers who had wildly different operations. It helped. It's verbose. As you said, this mostly attributable to JEE and projects that traded build time complexity and home-grown code for abstraction complexity.

I had to support systems from IBM, BEA, Apache, Red Hat, SAP, and some I'm certainly forgotten. Then there were the piecemeal systems. OSGi made an appearance. Then you have databases from Oracle, Microsoft, and IBM. Identity and auth was the wild west, with countless SSO vendors, wacky LDAP implementations, wackier SAML implementations, Kerberos, Ping... Despite that, it was pretty feasible to build and ship the same artifacts and configure things at the site.

Re: JEP 401: Value Objects (Preview) merged to OpenJDK master

#122

I think it is important to understand what this does and does not cover. This is “only the first part of Valhalla”. See e.g. a good summary at https://www.jvm-weekly.com/p/project-valhalla-explained-how-...

I agree, but this really is one of the most important and useful parts to land. Next is the null constraints. Generics will be useful, but not needed to get a large portion of the performance benefits.

With this finally integrated, we are also likely to start seeing pretty regular performance bumps for all things value related.

Re: JEP 401: Value Objects (Preview) merged to OpenJDK master

#123
post #15

I feel lonely in that: I mostly love Java as a language. The lack of value types is the biggest impediment to certain types of performance. I am really looking forward to this evolution of the language.

I've said this before but I'll say it again: The worst part of Java is Java programmers. For most of my career, I thought I hated Java, primarily because every piece of Java code I had ever worked with was overly verbose across a million different files to do things that would take like ten lines of code in any other language. Then I actually started looking at all the features for Java 8, 11, 17, and 21, and realize…

> The worst part of Java is Java programmers.

For companies that deployed Java this is the best part. Growth of Java from 1995-2015 and enterprise IT outsourcing was almost in lockstep. It was not for programmers with taste or interest in coding. It was J2EE 1000 page manual printed and distributed in bulk at IT vendors describing things in hugely verbose details with dummy pet-store project to use all facets of Java/J2EE that ingrained into overall Java culture.

It could be business or politeness reasons that well meaning Java language authors rarely spoke a word against this wider Java culture. So it was just assumed that overtly verbose code and organization of Java projects have official stamp to it.

Re: JEP 401: Value Objects (Preview) merged to OpenJDK master

#125

Earlier quoted context omitted.

It depends on how you look at it. C++ is very different since it is native. Java is a VM. This affects lots of decisions in weird ways. But in essence both commit to backwards stability at the end. C++ goes for performance, JVM for a more full-featured bytecode vm, etc. but still.

None of that prevents Java from blowing up their language with complex features. They are somehow able to sit back and work on proposals for years and end up with what makes sense for the language.

One thing the Java architects have said is they let most of the complex feature development happen outside of Java, which is pretty nice.

They let the likes of Kotlin, C#, C++, Scala, Haskell, etc all explore their own little features then they figure out if it could be integrated with Java and what it'd look like.

I really like that approach because it's slow, methodical, and the features typically are very well aligned with Java. None of them feel particularly out of place.

Java's preview system also works pretty well to get these features refined over time.

Re: JEP 401: Value Objects (Preview) merged to OpenJDK master

#127

Earlier quoted context omitted.

Unless CPU instructions become widespread that allow to process 128 bits in one step, then yes. Java will have the same limitations as any other language. Other languages simply don't make this explicit.

But if I don't care for object atomicity, can I get struct-like behaviour in Java for arbitrary large types?

From elsewhere I've seen that this is something they are thinking about offering but nothing concrete has surfaced. It would be an opt-in sort of thing where you say "I'm ok with my code breaking if I misuse this class".

It will likely require you poke in the `jdk.internal` package space.

Re: JEP 401: Value Objects (Preview) merged to OpenJDK master

#128
post #5

How much of Valhalla is this? 50% of it? 90% of it?

50% maybe. There are other projects that depend having it in place, SIMD (vectors), reiffed generics, non nullable types.

IMO it's the most important 50%. If this alone is delivered I'd call Valhalla a success.

Re: JEP 401: Value Objects (Preview) merged to OpenJDK master

#129
post #5

Earlier quoted context omitted.

50% maybe. There are other projects that depend having it in place, SIMD (vectors), reiffed generics, non nullable types.

IMO it's the most important 50%. If this alone is delivered I'd call Valhalla a success.

Agreed. The other are nice to have.

Re: JEP 401: Value Objects (Preview) merged to OpenJDK master

#130
post #15

I feel lonely in that: I mostly love Java as a language. The lack of value types is the biggest impediment to certain types of performance. I am really looking forward to this evolution of the language.

java the language is amazing the problem with it is entirely cultural. why is `IStatusChangeEntityCreationManagerFactory` everywhere? and why are the frameworks so huge and all encompassing? i think batteries included rails-style frameworks are great, but when i wrote Java, it didn't feel like rails at all none of these are language problems

This is specifically Spring culture, not Java culture in general. I don't tend to see this outside of Spring. Maybe back in the J2EE days, but that community seems to be more or less dead.

Java is a big tent. Yeah there are some parts that deserve this kind of mockery.

The Rails equivalent is over-metaprogramming. "I solved it with method_missing." I've worked on code like this in real life. TBH I'd rather have the inane verbose class names.

Post reply on HN