- The type system was essentially like java but perhaps even worse -- in a world with Rust, Haskell, Julia, Kotlin, Scala, and even Golang this seemed egregious.
- No algebraic data types (sum/union),
- class-based inheritance
- nullable values
- using exceptions instead of errors-as-values approach.
I know they worked hard on the language (rewrites are hard, there are some good talks on there about it, link @ end), but it's like they ignored all the progress in PL over the last like decade+. Anyway, continuing on:
- JSON serialization/deserialization[1] was like the worst parts of Go and the worst parts of Java (again this has to
- SQLite driver[0] couldn't be used off device. I found this out while trying to write tests that ran off-device. Now there's sqlite3[1] so maybe it's no longer an issue
- Dart2 was a played down rewrite of Dart1, with JS interop removed. Typescript is a better language than Dart.
- BloC is overcomplicated and was rolled out poorly at the time (this has more to do with Flutter than Dart). The state management patterns felt like unbaked react (flux pattern) v1.
All this said, Dart will probably be around for a very long time. Fuschia makes a LOT of sense for Google to continue pursuing, which uses Flutter. Dart could be worse, and I think it's good enough for a bunch of usecases. If it were me, I wouldn't even choose it over Nativescript.
The Boring Flutter Development Show[3] was/is fantastic, I watched it religiously when I was learning and trying out Flutter -- having a big backer like google means there are always going to be dedicated resources and smart people behind Flutter which honestly probably matters more in the long run than Dart being a shit language. As Golang has shown us, you can just iterate to having a good language.
Feels like Dart2 has it's base to build from now, and I don't like the places it's started, but it will probably continue to succeed. At the very least you won't see bad PR about it, because most people who are willing to tweet about it are invested in it's success or want jobs at Google someday, and there is dedicated money for "dev rel".
Seeing Sony embrace flutter for embedded things is pretty big as well[4]. Sony has a surprisingly strong track record of making technologically competent products:
- PS Vita (generally regarded as ahead of it's time)
- Sony SmartWatch 1 & 2 (I owned both, they were ahead of their time, and were very good quality, easily hackable)
- Sony XPeria phones & tablets (embraced open source and easy bootloader unlock, I own a tablet that I'm extremely happy with)
[EDIT] - Separate some points about the language, also add a link to the strange loop talk on the rewrite[5]
Thanks for the elaborate answer! You probably have a higher standard on programming languages than I do. I understand that Dart is a very basic language, and comparing it to something almost academic like Haskell will probably make it seem real primitive and stupid. Coming from mostly frontend/UI product dev in C#/Java/JS I've had a blast with it though.
I do agree that some common patterns are contrived (BLoC, json serialization via codegen, etc), but I'm not sure it's fair to criticize the language itself for this.
Also FWIW sound null safety is now the preferred way to write Dart (given your deps have adapted to it), so that part is hopefully solved.
> Thanks for the elaborate answer! You probably have a higher standard on programming languages than I do. I understand that Dart is a very basic language, and comparing it to something almost academic like Haskell will probably make it seem real primitive and stupid. Coming from mostly frontend/UI product dev in C#/Java/JS I've had a blast with it though.
Well I spend a lot of my time yak shaving so :). Most of the time in the real world, Dart is good-enough (and is definitely better than JS without TS, from a safety/maintainability perspective).
You're absolutely right, Haskell is academic, but what impresses me about other languages was that they took little bits -- Rust took a lot, Golang took a tiny bit (protocols look more like type classes than class-based inheritance).
I'm somewhat surprised that you prefer it to C# though -- C# was supposed to be better Java, and I didn't think that Dart was better than C# outright. Maybe I'm wrong on that, if it feels more fun to use (i.e. easier so much so that it's enjoyable, but you're not frustrated).
> I do agree that some common patterns are contrived (BLoC, json serialization via codegen, etc), but I'm not sure it's fair to criticize the language itself for this.
BLoC isn't fair to criticize (it's more about Flutter), but JSON serialization is fair in my mind because it's the direct result of a too-weak type system. But yeah overall I'm making the typical HN ado about nothing. In the real world people would just pick flutter (for it's good parts) and commit.
> Also FWIW sound null safety is now the preferred way to write Dart (given your deps have adapted to it), so that part is hopefully solved.
First I've heard of this addition, and it's commendable that they're undertaking this herculean effort, but this is so meh. Typescript arguably has this problem (since it has to interop with JS), but the way you solve it is so simple there. Turn on strict mode, and you're done -- because they considered it from very early on (if not the beginning). Language designers should know what the state of the art is and make good decisions around it up front, this is like 10x worse than writing a bad framework, because you can't drop out (of the framework) -- there is nowhere to drop out to (I mean... yeah you could FFI or something ridiculous but...).
But anyway I'm just tilting at windmills -- people that have to get shit done will just get it done with Dart like they have with every other tool that is less-than-perfect. I'll just stay in my ivory molehill.
It's all good, I enjoy hearing your perspective! To be honest I've never been greatly interested in programming languages as a subject in its own right. As such, and as you correctly assume, I only got into Dart because of Flutter. Since then I've used it for backend services as well, and it's very pleasant to me.
A lot of it probably comes from the excellent devex, but it strikes a nice balance between dynamic get-shit-done-ness that you find in JS/Python, and the more verbose, safe, structured nature of C#/Java.
Global imports, method cascading, extensive list comprehensions, named arguments, inference being heavily encouraged, flexible constructors. It's been a while since I did any serious large scale coding in C#, but I just remember it being more of a verbose slog.
I'd argue most companies do this, but do the bit where they never even embraced the developer communities in the first place.
The fact that those things were even allowed to exist is awesome, and the best thing I've seen out of MS on this front is Kinect. Not sure if Nintendo has done things that developer friendly.
Most companies are intent on making full on walled gardens.