HI version is available. Content is displayed in original English for accuracy.
Advertisement
Advertisement
⚡ Community Insights
Discussion Sentiment
91% Positive
Analyzed from 806 words in the discussion.
Trending Topics
#java#value#language#integer#github#types#object#openjdk#objects#https

Discussion (30 Comments)Read Original on HackerNews
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.
Do I love Spring? No. Do I prefer Typescript for my little side projects? Yes.
As a layman I would assume nothing is preventing it, other than the large amount of effort it would take to implement.
I do not have a lot of knowledge about the details but from the outset it seems like a rather bold move to me.
I learned this the hard way, when a C++ JNI extension I was working on accidentally overwrote the pooled value for zero, and all hell broke loose...
The cache can be extended on startup with env var `java.lang.Integer.IntegerCache.high `
https://github.com/openjdk/jdk/blob/cc278dbb8a1ca0754d584270...
- Java has long had a modern replacement for Date, while JavaScript's recently standardized Temporal API still isn't supported in Safari.
- Java has switch expressions, while JavaScript, despite its Scheme influence, does not.
- And now Java is getting value objects, while JavaScript's equivalent tuples & records proposal has been withdrawn.[0]
JavaScript was not developed as a fork of Java, but much of its basic syntax still resembles Java, so I think it's fair to compare them.
[0]: https://github.com/tc39/proposal-record-tuple
Naturally, a language that properly supports value semantics does not have any of these limitations.
I don't really see why you would need specific hardware to express a type in a programming language, though.
This is it https://github.com/openjdk/jdk/commit/cc278dbb8a1ca0754d5842...
The final singular commit is cc278db (8389219: Implement JEP 401: Value Objects (Preview), 2026-07-31) https://github.com/openjdk/jdk/commit/cc278dbb8a1ca0754d5842...
It started out as a highly invasive, highly disruptive and highly experimental branch that eventually turned into a beautiful specification that put semantics and performance payoff first and syntax seconds.
There are other projects that depend having it in place, SIMD (vectors), reiffed generics, non nullable types.