6 ms·
I agree they waited too long for strict nulls! However, both features I linked at currently proposed seem to be backwards compatible, so hopefully no switch.
by bcherny 9y ago
I agree they waited too long for strict nulls!
However, both features I linked at currently proposed seem to be backwards compatible, so hopefully no switch.
- shados 9y agoFor sure that's great. The issue are still: - it's not there today - it still has to be bolted on (eg: adding new keywords, as opposed to, let say, Flow automatically doing nominal typing for Classes, which was the right move). - The ecosystem did not get to take advantage of it for years, so existing types, libraries, etc, are not written that way. That's a lot of tech debt. That's why new languages keep popping up all the time. The later you bring in critical features, the more bloated you force the system to be. I will admit TypeScript has been doing a decent job at containing the bloat (most of the crap features were actually what they implemented super early on, like the namespaces, enums, etc...the new stuff is really cool). But I think having proper competition enabled that: see the original strict null issue, where people were all but saying it was not possible/practical. Good thing we had Flow as a counterargument. Now with Flow dying a slow death, we'll have less fragmentation (great!), but less competition (possibly stagnating language. Boo!)
- bcherny 9y agoI agree on both points. An interesting facet of your 1st point is Stroustrup's Rule [0], which gives more context for an explicit `nominal` keyword. [0] https://thefeedbackloop.xyz/stroustrups-rule-and-layering-over-time/ https://thefeedbackloop.xyz/stroustrups-rule-and-layering-ov...
- shados 9y agoYeah I can totally see that. I liked the classes are nominal, plain objects are structural because its close to what people expect without even knowing the difference. But yes, TypeScript was very much designed for a target audience (all of the C#/Java-style class features and namespace stuff early on, which less and less people want as time go and people learn about better ways of doing things). It seems inevitable to me that eventually (might take decades), Haskell-level type systems will be the norm and people will learn them in highschool. The world is just not ready (and neither am I)
- bcherny 9y ago> It seems inevitable to me that eventually (might take decades), Haskell-level type systems will be the norm That would be exciting, but I can't help but wonder if FP is just a matter of taste. We had Smalltalk and ML in the 70s, C++ and Erlang in the 80s, Java and Haskell in the 90s, and now it feels like all the best languages at least nod to a multi-paradigm approach: Scala, Swift, Python, JavaScript, C#, Rust, etc. The right tool for the right job, you know? > and people will learn them in highschool I'm actually working on a book along these lines! Look for it on HN in a few months :)