What's the latest status? Is it still limited to 63-bits of data plus 1 bit for nullability?
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.
JEP 401: Value Objects (Preview) merged to OpenJDK master
21–30 of 185 posts
Re: JEP 401: Value Objects (Preview) merged to OpenJDK master
#22What's the latest status? Is it still limited to 63-bits of data plus 1 bit for nullability?
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.
I don't really see why you would need specific hardware to express a type in a programming language, though.
Re: JEP 401: Value Objects (Preview) merged to OpenJDK master
#23I 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.
Do I love Spring? No. Do I prefer Typescript for my little side projects? Yes.
Re: JEP 401: Value Objects (Preview) merged to OpenJDK master
#24Re: JEP 401: Value Objects (Preview) merged to OpenJDK master
#252934 commits OMG... huge work.
The final singular commit is cc278db (8389219: Implement JEP 401: Value Objects (Preview), 2026-07-31) https://github.com/openjdk/jdk/commit/cc278dbb8a1ca0754d5842...
Re: JEP 401: Value Objects (Preview) merged to OpenJDK master
#26Earlier quoted context omitted.
Java has a mechanism for Integer and Long objects caching using something that already looks like value object, cached objects can be compared using ==. hashCode of Integer already returns int, the boxed int value. Not much of value is lost.
Of particular note, all 1-byte Integers are interned, there is a pool of small Integers from -127 127 which are reused whenever possible. 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...
Re: JEP 401: Value Objects (Preview) merged to OpenJDK master
#272934 commits OMG... huge work.
The way pull requests and commits work in the OpenJDK repository -- a bot squashes each pull request into one commit: https://github.com/openjdk/jdk/pull/31120#issuecomment-51378... The final singular commit is cc278db (8389219: Implement JEP 401: Value Objects (Preview), 2026-07-31) https://github.com/openjdk/jdk/commit/cc278dbb8a1ca0754d5842...
Re: JEP 401: Value Objects (Preview) merged to OpenJDK master
#28What's the latest status? Is it still limited to 63-bits of data plus 1 bit for nullability?
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.
Naturally, a language that properly supports value semantics does not have any of these limitations.
Re: JEP 401: Value Objects (Preview) merged to OpenJDK master
#29Earlier 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.
We've had MMX for a while now, I don't think we need to wait much longer. I don't really see why you would need specific hardware to express a type in a programming language, though.