4 ms·
I feel that is unneccessary, because if I want type annotations, then I can just use TypeScript. Although adding them in Python didn't hurt and was a net win I
by captainmuon 4y ago
I feel that is unneccessary, because if I want type annotations, then I can just use TypeScript. Although adding them in Python didn't hurt and was a net win I would say. But I'm not sure how feasible it is, because you want backwards compatibility with JS, and if you have to preprocess anyway to remove the annotations, why not use TS proper.
But I like it for another reason. The single most frustrating thing for me in JS is the lack of operator overloading. Matrix operations become so ugly if you can't use infix operators. If you do complex graphical calculations it is really important that the calculations remain readable.
Custom operators and operator overloading require type-dependent dispatch. The types could be known at compile time in TS. But the developers will not add any such feature, unless JS has it. One of a few prerequisites seems to be that JS gets type annotations!
But honestly it seems I would have to wait until JS becomes TS, before we can overload operators. Maybe it is more realistic to add this via babel or so.