News for hackers. Stuff that matters.
Re:Inheritance Often Doesn't Make Sense by smaddox on Saturday March 17, 2018 @11:06AM (#16607267)
Excellent point! I think it's fair to say that substitutability can only be satisfied (in general) for a fixed set of operations. This is why I believe Haskell's (and by extension Rust's) approach to bounded ad-hoc polymorphism is the best that I've seen in a production language. Going beyond Haskell, Rust also allows you to choose static dispatch, making bounded polymorphism zero cost. Dynamic dispatch is still available, when desired or needed (but it's almost never needed).
Re:Inheritance Often Doesn't Make Sense by jdmichal on Saturday March 17, 2018 @03:52PM (#16608745)
I'm a huge fan of the Rust and Haskell systems for exactly this reason. I sometimes play with the idea of a language that has that kind of type system, but with a more forgiving environment Rust or Haskell. Something like C#, but swap out the type system to feel more like Rust.