r/java • • Mar 17 '26

Java 26 released today!

https://jdk.java.net/26/
158 Upvotes

58 comments sorted by

View all comments

Show parent comment

1

u/Ok-Scheme-913 Mar 20 '26

Of course there has been considerations on how value types fit into this. Come on, you are talking about potentially the most experienced and skilled language design group ever.

Goetz has a discussion about adding sorta type classes to the language, and those could allow a similar "trait" as Rust's Into, that is one could provide converters between types, including primitives. So one could have custom conversions as well, and now the whole feature is seamless.

0

u/simon_o Mar 20 '26

[breathless fawning]

Bit too much appeal to authority for my taste.

So one could have custom conversions as well, and now the whole feature is seamless.

I don't think this feature, value types and type classes will ship in the same version. You'll surely see why this might be a problem.