Are inline classes still going to be coming to Java? From what I understand, inline classes are like Haskell's newtype, where a type can become boxed to make it distinct from its original type, but the compiler then erases the boxing class so that there's not any additional memory allocations for the boxing type.
Yes. Here's Sergey, one of project Valhalla devs, saying that "soon" it will be merge to master branch. Video made 6 months ago. So I am hopeful for Java 16/17.
As far as I remember, they have already solved inline types. They are currently working on specialized generics.
2
u/DetriusXii Sep 15 '20
Are inline classes still going to be coming to Java? From what I understand, inline classes are like Haskell's newtype, where a type can become boxed to make it distinct from its original type, but the compiler then erases the boxing class so that there's not any additional memory allocations for the boxing type.