2 ms·
It could be a feature flag, like `use strict`, but `use types` instead
by rpmisms 5y ago
It could be a feature flag, like `use strict`, but `use types` instead
- runarberg 5y agoI’m actually hoping for something more akin to python’s optional type annotations. Where opting in is as simple as using type annotations. The runtimes (i.e browsers, nodejs, etc.) would then simply ignore them like they do with comments. But third party tools could use them to do some static analysis. Like mypy does for python (or tsc --noEmit does for javascript).
- rpmisms 5y agoIt really depends on if you want enforced typing, which is why I think a feature flag could be useful. There's room for both—explicit typing being available, and enforced types being a flag away.