Hacker News new | ask | show | jobs
by grishka 828 days ago
They will eventually bring value types to Java with Project Valhalla.
2 comments

I wonder how long it will take. We’ve been waiting for ten years already.
One 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.

Looks like we may see a first preview in Java 23, i.e. already this year.
Noting 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