I recently started learning Dart because I was curious about how easy it is to write a cross-platform mobile app in 2019. Turns out it’s very easy. And the reason is that Flutter is a thing, and Flutter is a thing because of Dart.
Dart’s advantages summed up:
- Can be compiled AOT or JIT. AOT for fast performance when your app is ready for prod. JIT for fast prototyping (shortens the feedback loop between when you write your code and when you see what it does). Oh my, hot reload in flutter is killer.
- No markup. You can declaratively define interfaces in dart since it’s designed to be used that way. Flutter takes full advantage of this and I super appreciate learning a single language to do both my business logic and my UI.
- Single-threaded language with no preemption. Why is this good? It has a modern generational GC without preemptive scheduling, so the thing is not like OG android where your UI locks up every so often. Your 👏 UI 👏 will 👏 be 👏 smooth.
- Disallowed shared memory in threads, which means no locks!
Isolatesdon’t have shared memory; instead they communicate over channels a la erlang. Good modern lockless concurrency shit.
- Compiles cleanly to native code (objective C, java).
Having experienced hot reload and remembering the old days of UI development I am now a huge fan of Dart. The compiler people know what’s up!