2934 commits OMG... huge work.
JEP 401: Value Objects (Preview) merged to OpenJDK master
11–20 of 185 posts
Re: JEP 401: Value Objects (Preview) merged to OpenJDK master
#122934 commits OMG... huge work.
Re: JEP 401: Value Objects (Preview) merged to OpenJDK master
#132934 commits OMG... huge work.
Seems like a horrible way to work. Why could this not have landed as a large amount of smaller PRs in a more incremental fashion, maybe Java users could have gotten some value out of it earlier.
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.
Re: JEP 401: Value Objects (Preview) merged to OpenJDK master
#142934 commits OMG... huge work.
Seems like a horrible way to work. Why could this not have landed as a large amount of smaller PRs in a more incremental fashion, maybe Java users could have gotten some value out of it earlier.
Re: JEP 401: Value Objects (Preview) merged to OpenJDK master
#15The lack of value types is the biggest impediment to certain types of performance. I am really looking forward to this evolution of the language.
Re: JEP 401: Value Objects (Preview) merged to OpenJDK master
#16- 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.
Re: JEP 401: Value Objects (Preview) merged to OpenJDK master
#17What's the latest status? Is it still limited to 63-bits of data plus 1 bit for nullability?
Re: JEP 401: Value Objects (Preview) merged to OpenJDK master
#18Re: JEP 401: Value Objects (Preview) merged to OpenJDK master
#19If I understand this correctly then Integer becomes a value class and every instance of it loses its object identity. I do not have a lot of knowledge about the details but from the outset it seems like a rather bold move to me.
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.
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...
Re: JEP 401: Value Objects (Preview) merged to OpenJDK master
#20If I understand this correctly then Integer becomes a value class and every instance of it loses its object identity. I do not have a lot of knowledge about the details but from the outset it seems like a rather bold move to me.