Hacker News new | ask | show | jobs
by GeorgeTirebiter 1735 days ago
It would be helpful if you would explain/teach us why Dart is a mediocre language. With examples if you can. What would you suggest instead?
4 comments

Although Dart's creators have pedigree it's identity is somewhat confused. It started out as an alternative to Javascript for the Chrome browser then Google abandoned that goal and adapted it to be more JS-compatible. That may be why Dart is single-threaded. Why on earth would any language creator settle for single-threaded when we live in a multi-core world. That's what I find so disappointing about Dart. That and it's desire to be just some kind of average of other mainstream languages.
Dart is not single threaded. Dart isolates are the equivalent of threads, but they cannot share memory like threads. As anyone who works in UI knows the UI/ main thread is 1 thread (not a thread pool), because concurrent UI development hasn't been done well. https://stackoverflow.com/a/5544714/7365866

If you want to do heavy computation, you can easily call `compute()`. Dart VM manages a thread pool for that. A thread can execute multiple isolates though, its not a 1-1 mapping between threads and isolates.

IMHO, it was designed for developer productivity (not just speed of writing code), but JIT + AOT compilation to provide quick development but still fast apps for users, and as you can tell, many developers love it. An existing problem for Flutter is shader compilation jank, but this is being worked on by the Flutter team.

Read "Why did Flutter choose to use Dart?": https://flutter.dev/docs/resources/faq#why-did-flutter-choos...

A modern language without ADTs + pattern matching, gets a big nope from me.
It started out as a compile to js language (think coffeescript), then they created a vm for it. Google made dart so that they wouldn't have to directly compete with react native/cordova.
That's actually the exact opposite of reality: Dart was a retention project for Lars Bak, and it was designed specifically with a focus on being able to make a fast VM implementation. The goal from the beginning was to have native support in browsers (they even got an ECMA standard for it!), and support compile-to-js as a polyfill until browsers had native support, but they couldn't convince any of the other vendors and so not even Chrome supported it. Some time after that, Lars Bak left Google.
I could explain it as Dart not having any features other than what any of the mainstream language has but that would not be much of an explanation would it? What is special about Dart?

I'm aware we have plenty of mediocre mainstream languages existing right now, but they all exist for historical reason and have rather useful ecosystems. However, to go out of the way to just make a new lame ass syntax, with zero ecosystem, and no distinguishable characteristic (which is why Flutter is always involved in selling it) why would you do that?

I'm all for new new paradigms, languages that are different like haskell or scala to flourish and teach us new ways of thinking, this is not it.

When Dart was launched Javascript (Typescript) was not really a enjoyable language to use. For me at least it filled that void as a strongly typed language I could use on the web and server side that was easy to pick up. I thjnk that was the niche it was trying to fill and wasnt just made for the sake of it.
The original mission of replacing JS in the browser failed. At that point they could've called it off. Instead they doubled down with Dart 2.0, which, could've been great if there is actually anything 2.0 about it. It's still just some language with curly braces.

During the same time frame of Dart's existence, other languages that actually have innovative ideas were able to carve out their niches (go, rust, ts, kotlin, swift... list goes on), while Dart still has to rely on some UI toolkit to sell.