3 ms·
Well, what mainstream language has better tools for composition?
by gf000 7mo ago
Well, what mainstream language has better tools for composition?
- fingerlocks 7mo agoRust with traits and Swift with protocols
- gf000 7mo agoSo 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.
- joe_mwangi 7mo agoHere it is https://youtu.be/Gz7Or9C0TpM?si=Rk5pTeAC6ibqS-M- https://youtu.be/Gz7Or9C0TpM?si=Rk5pTeAC6ibqS-M-
- megapoliss 7mo agokotlin
- owlstuffing 7mo agoKotlin'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/manifold-deps-parent/manifold-delegation/README.md https://github.com/manifold-systems/manifold/blob/master/man...