4 ms·
Dart's claim to fame was a static type system, but TS's type system eventually surpassed Dart's and then some: TS not only gives lots of escape hatches from sou
by chuckadams 2y ago
Dart's claim to fame was a static type system, but TS's type system eventually surpassed Dart's and then some: TS not only gives lots of escape hatches from soundness because the JS ecosystem is messy and needs it, but it also doesn't repeat Dart's colossal mistake of making every generic type covariant then inserting runtime checks on writes (something everyone knew was a mistake after Java arrays and Eiffel did it).
Dart has some things in its favor: it's not defined by underlying JS semantics, so it's free to jettison some of its legacy (bye bye `undefined`). Unfortunately its changelog doesn't paint a picture of an evolving language.
- kjksf 2y agoDart "lost" because it was a completely different language than JavaScript, with completely different , much smaller ecosystem of libraries and thus huge switching costs. TypeScript, being a type system over JavaScript, re-uses JavaScript ecosystem and allowed incremental adoption. Dart is now "winning" because Flutter is a very good way to write once and deploy on Android and iOS (and maybe in the future on web and desktop). That drives adoption of Dart and builds ecosystem of libraries.
- chuckadams 2y agoYah I just added the bit about Dart not being chained to JS, which is potentially a big win. But stuff like generic covariance is a whopper. Still, they fixed null-safety and implicit downcasts (which was pure WTF), so there's hope yet.
- brabel 2y ago> Unfortunately its changelog doesn't paint a picture of an evolving language. You haven't kept up with Dart in the last 3 or 4 years, have you?? They've improved almost every part of the language in this timeframe, I don't know what is an "evolving" language if Dart isn't it.
- chuckadams 2y ago> You haven't kept up with Dart in the last 3 or 4 years, have you?? Not lately, but to my shame the changelog I looked at stopped at Dart 2, so I got a poor picture of things. Looks like variance annotations are still “experimental” though, but I take back what I said about Dart standing still.
- brabel 2y agoIt's easy to make that mistake if you don't use Dart, I was also shocked as I had played with Dart 1 long ago, and when I "came back" to it many years later, I found a totally changed language. I would suggest having a look at the changes since Dart 2 here (Dart is currently at version 3): https://dart.dev/guides/whats-new https://dart.dev/guides/whats-new There's A LOT of new stuff (new releases every 6 months or something like that, similar to Java).