Crafting Interpreters: Superclasses
> Now onto the new instruction:Adding a special VM instruction for such operations as inheriting from a class is a strikingly bad design decision.You want to minimize the proliferation of VM instructions as much as possible.A rule of thumb is: is it unreasonable to compile into a function call? Or else, is it likely to be heavily used in inner loops, requiring the fastest possible dispatch? If no, don't add an instruction for it. Compile it into an ordinary call of a run-time support function.You're not going to inherit from a class hundreds of millions of times in some hot loop where the application spends 80% of its time; and if someone contrives such a thing, they don't necessarily deserve the language level support for cutting their run-time down.