Echo JS 0.11.0

<~>

tracker1 1412 days ago. link 1 point
I'm not sure we need to go down the path of polymorphism by declaration in JS, let alone dealing with the fallout that comes with it.  The inheritance model in JS has some real inefficiencies that are amplified by multiple layers of inheritance already and growing them with multiple signatures for methods won't do good at all.  Especially without a type system, and there's already TypeScript for that, and even then it can only end badly as then you'll need runtime type checking that will fail in practice.

You're far better off embracing more functional or procedural approaches to software constructs in JS and leveraging the Class sugar when you need to encapsulate state with methodology and pass that around as a contextual pairing, and avoiding them everywhere else.

If you really want that kind of construct, I'd suggest working with a language that has the features you want targeting webassembly as the output.  Not saying it's a good idea in many cases, but better than trying to shoehorn such a mess into JS.