3 ms·
Being able to gradually introduce types into an existing code base seems like a poor reason to use unsound or quirky features in a language. I’d then much rathe
by alkonaut 7y ago
Being able to gradually introduce types into an existing code base seems like a poor reason to use unsound or quirky features in a language. I’d then much rather use a small and consistent language if I’m going to compile to js anyway, even if it’s not useful as a migration path.
What seems like a good reason for accepting language design tradeoffs on the other hand is the package ecosystem. A language that doesn’t work seamlessly with existing third party js is probably doomed. It’s not too difficult to write a tiny language that is nice and consistent and compiles to js, but few will use it if you need ffi to interact with js code. The impressive engineering effort in TS is all about these tradeoffs.
This is why I’m having a hard time loving TypeScript, it’s a language for solving a real world problem (bringing types to the js ecosystem) in a pragmatic way, and that rubs me the wrong way. It acknowledges that js, js developers, and js packages are not going to going away any time soon.