Live data from Hacker News

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

github.com

171–180 of 185 posts

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

#171
post #97

Earlier quoted context omitted.

Show me where IStatusChangeEntityCreationManagerFactory is in the language. Or the standard libraries. Or anything like it

https://docs.spring.io/spring-framework/docs/current/javadoc...

"the language. Or the standard libraries"

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

#173
post #169
post #168

Earlier quoted context omitted.

Ok, it's possible that my bilingual ahh is misunderstanding the comment. Maybe we can try to come to an understanding? I read that comment as "Show me where [long classnames] are in the language, standard library or ." Spring is one of the biggest java libraries and quite widely used. I think it fits rather nicely, even if the example itself is fairly old.

Yeah I just think you have a fundamental misunderstanding of what the ecosystem is. Spring is used less than you think.

It's clearly still very popular.

https://survey.stackoverflow.co/2025/technology#1-web-framew...

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

#174
post #167

Earlier quoted context omitted.

Fortunately, there are plenty of mature alternatives to Spring these days.

What are those alternatives? I haven't touched Java for web development for a very very long time.

Quarkus, Micronaut, Helidon are all the big players. Quarkus has the most market share and is quite enjoyable to work with.

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

#175
post #103
post #73

Earlier quoted context omitted.

Yeah - it's a bit non-intuitive you can change the value of a number. https://thedailywtf.com/articles/Disgruntled-Bomb-Java-Editi...

Such hacks will slowly stop working (without explicitly allowing it from the command line.) In this example, it would throw an IllegalAccessException, because java.base doesn't open java.lang.

Doesn’t field.setAccessible(true) already throw on a modern version?

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

#176

Modern Java friggen rocks. I honestly cannot understand why you would use anything but the OG these days!

scala 3 exists

At this point I don't understand why to use a JVM language with anything but Java. Java is a "good enough" language now and is still the premier ecosystem driver, getting all of the big-budget upgrades and attention -- but it's still a PITA, mainly because of the terrible tooling surrounding deploying an app with the JVM. My point is, the JVM is both the best and the worst thing about Java, so if you're clojure (cough common lisps) or scala (cough OCAML/Haskell) it seems like you're making life hard for no reason -- there are at least equivalent if not better alternatives that can actually compile to a deployable binary.

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

#177

I keep forgetting the reasoning for this part of the design - why is the value semantics baked in the declaration site and not at the use site? Why does the class author have to declare it as a value type? I know this has been rehashed before many times by Brian but I keep forgetting the reasoning.

I think it keeps going back to "preserving type invariants". Turning an object into a value can have surprising constraints on the integrity of the type. These include: forced empty constructor (for bulk initialiation in arrays), violation of cross-field invariance (think of a Range-type where "end" value is suddenly smaller than the "start" due to a data race), etc.

Java always had a focus on enabling library authors over empowering call-site users. And I think approach has proven its dividend.

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

#178

Earlier quoted context omitted.

Valhalla is 99% done by Oracle, yes.

I’m impressed by their uncharacteristic discipline and long term vision. In the big tech I know this would get pushed early.

I'd say it is very characteristic of the Java team at Oracle to be committed to discipline and long term vision.

I strongly suggest watching some of their talks from JVMLS (JVM Language Summit), especially the ones from Brian Goetz and Mark Reinhold.

https://www.youtube.com/playlist?list=PLX8CzqL3ArzUOgZpIX6Gs...

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

#179
post #165

Earlier quoted context omitted.

> Or anything like it

I meant anything like "IStatusChangeEntityCreationManagerFactory"

Fair, the standard library is not quite so awful. There are still some pretty long names in it though.

https://docs.oracle.com/en/java/javase/23/docs/api/java.base...

Or this 6 word beast: https://docs.oracle.com/en/java/javase/21/docs/api/jdk.dynal...

This is probably the most enterprisey sounding, but not the longest class I could find: https://docs.oracle.com/javase/8/docs/api/javax/naming/spi/I...

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

#180
post #141

Earlier quoted context omitted.

The JVM goes for performance, too, only with an emphasis on the performance of larger programs. It's designed to address some of the serious performance issues that large C++ programs tend to suffer from (I originally made the switch to Java because it was getting hard to keep the large C++ applications we were working on fast enough; Java does some optimisations that are hard for a C++ compiler).

Well, yes. True that for long-running apps JVM seems to be tuned. I meant the kind of "perf-to-the-instruction" thst native can generate vs other considerations.

One thing we C++ programmers know, though, is that direct control over instructions helps performance in small programs but can hurt it in larger programs. E.g. it is really hard to enjoy the performance benefits that moving collectors and JITs can bring in large C++ applications.
Post reply on HN