4 ms·
They will eventually bring value types to Java with Project Valhalla.
by grishka 3y ago
They will eventually bring value types to Java with Project Valhalla.
- layer8 3y agoI wonder how long it will take. We’ve been waiting for ten years already.
- kaba0 3y agoOne design iteration already has a working, implemented branch available, it’s just one of the hardest designs to get right, to remain backwards compatible, to have it work nice with generics and all the other features, etc. So once they actually settle on a design (which they seem to have closed on quite a lot in the last couple of years), it might not take that long to happen.
- ivan_gammel 3y agoLooks like we may see a first preview in Java 23, i.e. already this year.
- soulbadguy 3y agoNoting that Valhalla value types are about guaranteeing object value identity with memory layout and/or flattening supposedly deriving from that. Modeling unmanaged sequence of bytes within the type system (like receiving a typed buffer from un managed code) might still be challenging