News for hackers. Stuff that matters.
Re:Inheritance was invented as a performance hack by loopz on Thursday April 29, 2021 @11:24PM (#26989566)
Maybe he meant something similar to Go interfaces, but they are abstract and coupled loosely with implementations after the fact.

That or abstract class/pure interface. There's no need for default implementations introducing assumptions in code.

Re:Inheritance was invented as a performance hack by rectang on Thursday April 29, 2021 @11:55PM (#26989695)
I believe that both Go and Rust use two-word fat pointers for interface types. I was actually thinking of Rust traits first and foremost; in Rust, traits can supply default method implementations which invoke other methods defined in the same trait.

While I take your point about introducing assumptions, I'm reluctant to give up the convenience of default implementations; they seem to present fewer problems than classically inherited methods because shallow hierarchies are more common with interfaces than with classical inheritance, and because default interface methods cannot directly access member variables because they do not know about object layout — unlike methods inherited from a parent class under classical inheritance.

Re:Inheritance was invented as a performance hack by ratww on Friday April 30, 2021 @05:59AM (#26991562)
"Interfaces with default implementations" are a thing in Java and in some other languages, but most people don't know about them:

https://docs.oracle.com/javase/tutorial/java/IandI/defaultme...

Re:Inheritance was invented as a performance hack by rectang on Friday April 30, 2021 @08:29AM (#26992541)
I knew that Java added "default methods" to its interfaces a few years ago, but wasn't sure whether Java uses "fat pointers" like Rust and Go.