4 ms·
indeed we are in a new age of javascript now. one where TS support is (in practice) not optional. https://www.swyx.io/writing/js-third-age/ https://www.swyx.io/
by swyx 6y ago
indeed we are in a new age of javascript now. one where TS support is (in practice) not optional. https://www.swyx.io/writing/js-third-age/ https://www.swyx.io/writing/js-third-age/
- novok 6y agoMight as well make it part of the language officially and get rid of the need for transcompliers.
- kylemh 6y agolaughs in browser compat
- mekster 6y agoNot going to happen anytime soon as people will take forever to upgrade to browsers that may support TS natively. Stick with transpilers and you're good to go from today. There's also deno for node.js alternative that supports TS natively but not sure of its future.
- hajile 6y agoWe really need a "use types" mode. Instead of trying to support all the super-dynamic parts of JS, those parts should just go away in typed mode. Unlike TS, the type system should be sound. Hindley-Milner with immutable by default and options instead of null with structural typing everywhere and typeclass module definitions. I guess that's just StandardML with JS syntax, but that would be an amazing language to work with -- far better than either TS or ReasonML.
- still_grokking 6y agoReasonML is ML (OCaml) with JS syntax. OCaml has more features than SML. So I'm not sure what you're after. And regarding "the dynamic parts should just go away": No, please! And I'm saying this as a full time Scala dev doing "pure FP" in my day job who loves static types. But I also really like the "super-dynamic" parts of JS. I think such features should get integrated into some static lang. This would need some thinking though. The "old" static languages can't do that easily. To bring an example of what I mean: One can see JS objects as "extensible records". Adding and removing props on a prototype looks for example like "a super-dynamic" feature. But "extensible records" are also doable in static langs. I think more of those "super-dynamic" features are actually doable in a static context. Extending current FP languages with all kind of such features would be quite desirable, imho. "Why not have both?" :-)