Hacker News new | ask | show | jobs
by cutler 1734 days ago
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.
1 comments

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...