This reminds me how the first C++ compilers at AT&T translated C++ source code into C source code, presumably using the same methods you’re describing to implement polymorphism and inheritance. If you’re curious see Design and Evolution of C++ by Stroustrup.

Expand full comment
Nov 27, 2023·edited Nov 27, 2023Author

Yes, sounds like this technique could easily be wrapped around by syntactic sugar and supported by a compiler. Although, looking at the internals of a modern C++ compiler is not for the faint-hearted. I would like to see how interfaces are implemented in a relatively simpler compiled language, e.g. golang.

Thanks for the book suggestion, I will check it out.

Expand full comment