Re:Java 26 is here, and with it a solid foundation for the f...
by gf000 on Wednesday March 18, 2026 @03:11AM
(#47422501)
Well, what mainstream language has better tools for composition?
[ Parent
| on HN ]
Re:Java 26 is here, and with it a solid foundation for the f...
by fingerlocks on Wednesday March 18, 2026 @04:11AM
(#47422982)
Rust with traits and Swift with protocols
Re:Java 26 is here, and with it a solid foundation for the f...
by gf000 on Wednesday March 18, 2026 @04:52AM
(#47423257)
So just type classes?
How does a type class help with composition? They do help with the expression problem (adding support for an "interface" after definition), and via parametric polymorphism they might give you a bit with regards to composing two traits.. but you do also have generics in Java, even if not as good as type classes.
So anyways, I don't see as big of a change here. But there was a Brian Goetz mail/presentation somewhere where he talked about adding "basically type classes" to Java? But unfortunately I couldn't find it for you now.
Re:Java 26 is here, and with it a solid foundation for the f...
by joe_mwangi on Saturday March 28, 2026 @06:54AM
(#47553424)
Re:Java 26 is here, and with it a solid foundation for the f...
by megapoliss on Wednesday March 18, 2026 @07:50AM
(#47424510)
kotlin
Re:Java 26 is here, and with it a solid foundation for the f...
by owlstuffing on Wednesday March 18, 2026 @03:36PM
(#47430413)
Kotlin's "delegation" feature isn't true delegation, it's just call forwarding, which is better than nothing, but it falls down pretty quickly as an alternative to implementation inheritance.
The manifold project provides true delegation[1] for Java.
1. https://github.com/manifold-systems/manifold/blob/master/man...