> [!thought] > The wide pointer approach is used by [[Go]] (interfaces) or [[Rust]] (traits). **Literatures:** - https://www.youtube.com/watch?v=wU8hQvU8aKM - https://en.wikipedia.org/wiki/Dynamic_dispatch#Go,_Rust_and_Nim_implementation It's an article on [[Go]] and [[Rust]]; I'm not sure why I didn't think about this (well, I don't code [[C++]] a lot so it doesn't come natively). But few very nice observations: - always thought that the manual marking of `virtual` was weird; [[Java]] improved this a bit by making *everything* virtual, but that is also tricky too. - So many problems of the classical [[OOP]] is around supporting inheritance hierarchy and even multiple inheritance. the object encoding vtable (and runtime type information) at its representation makes sense in this world. - the fat pointer model allows the code to be "as efficient as C" if dynamic dispatch is not used. - i really like this because in many cases, dynamic dispatch is necessary purely for testing; mocking is a good use case for an alternative implementation. - if you squint really hard, the [[TypeScript]] way of programming; where the objects are normally pure data objects - is kinda like wide pointers (where the logic resides outside).