5 points · by theanonymousone · 11mo ago · 10 comments
It however "evolved" into being almost only used in Flutter, for developing mobile, web, and desktop front-end development.
It seems bizarre to me that a language is so special-purpose for front-end. Even Ruby has some fringe use cases beyond Rails.
Does Dart have any particular features that justify such a decision to bind Flutter to it? Or it has all been accidental?
Thanks
There have been lots of previous discussion about Darts strengthweaknesses and why Google chose Dart for Flutter. To sum it up, Darts strengths is JIT/AOT compilation, hot reload, concurrency, null safety to deliver performant UIs across platforms without JS interop or markup bridges.
Google tested other languages but stuck with Dart for its “UI as code” fluency, hot reload that preserves app state and native performance parity on mobile/web/desktop.
Of course, other frameworks and languages is catching up to features and DX that Dart and Flutter offers.
Even though Dart was meant for UIs, there is work being done to make it a viable option for backend dev as well, see Serverpod. Dart also finally implemented cross compilation this year which helps with shipping binaries to other machines.
But IMO, languages should focus on a niche. Dart has a clear niche - mobile.
It handles mobile and responsive layouts very well. It handles async well (mobile operating systems, mobile lifecycles, web). It handles lightweight client-side databases well.
It handles state management easily. Meaning you can chain things like login -> GET user email -> GET user avatar -> show avatar.
It translates all this logic well across platforms. Naturally it coupled well with Flutter and cross-platform.
Complexity scales logarithmically rather than exponentially, compared to say, a native Android stack from 2017 built with fragments, events, and data binding XML. It went so well that Android and iOS started copying the way Flutter did things.
The bundle sizes are also quite large compared to typical web frameworks, and you don't get progressive enhancement - it's all or nothing JavaScript.
Maybe things have improved in recent years, but I haven't seen much adoption or buzz around it.
That said, React Native has many great third party libraries whereas Flutter is dominated by a lot of low quality solutions.
Expo / RN → Flutter → KMP → Native