The last time I used Dart, it felt like the worst parts of C# + Java put together somehow.
The type system was verbose yet relatively weak in comparison to something like Typescript, it'd already been rewritten once (which isn't a bad thing), and it was almost unusable outside the platform (I remember trying to write tests for something using sqlite.dart and then realizing that you just... couldn't).
Flutter is an amazing technical achievement, and to some extent so is Dart (there's a great talk from strangeloop about it) but I just... want to be able to use anything but Dart in there. Being able to use Typescript with Flutter would be heaven (JS compatibility was something in early versions of Dart that was removed).
Dart is at least adding new features relatively quickly (just recently they started working on immutable record data structures with pattern matching, which even TypeScript doesn't have yet) and soon they'll have static metaprogramming meaning you can have Lisp like macros to create your own syntax, including algebraic data types as in any functional language. That is really what people are looking forward to.
Another thing is Dart is JITed, AOT compiled as well as compiling to JS and WASM. Very few languages can do all 4. JVM ones can't, so no Kotlin (we'll see how well Kotlin Native works), and V8 isn't AOT so no JS or TS either. Only alternative I can think of is Lua.
It is easy to iterate fast on language design when you don’t care about backwards compatibility.
> Very few languages can do all 4. JVM ones can't
Java can (JIT is trivial, for AOT there is among others Graal, for JS and WASM there is TeaVM (which works on class files, so now that I think about it, pretty much every JVM language can do all platforms), but also the very great Closure compiler (j2cl) which has no relation to cloJure, made and used heavily by google)
Backwards compatibility is overrated, sticking to it too hard is how we get stuff like JS or C++ that have ten different ways of doing the same thing. I'd much rather a language be improved and break sometimes than to convolve around keeping strict BC. Anyway, they have good BC support since Dart 2 released several years ago so I'm not worried.
With your Java example, that's exactly what I mean, you don't need 4 different tools in Dart to achieve the 4 types of compilation, they're all included in the standard Dart compiler/SDK. Sure, if we go by your definition, probably any language has some level of support for each via various random compilers but I'm talking about something first-class, built-in.
> Backwards compatibility is overrated, sticking to it too hard
While there is surely a very delicate balance of slowly deprecating a few things, remember that the only significant productivity booster is relying on existing code (as per Brooks).
I’m fairly sure there are orders of magnitude more Java code transpiled to JS running at Google than all of their Dart codebases combined, so not sure “random compilers” are a fair description.
I think you have made the case for ClojureDart. Clojure does not do the Typescript strong typing thing, but it meets the "Not Dart" requirement pretty well.
And my specific contrib, Matrix, handles state management and the whole reactive thing pretty well, one area where I see a bit of thrashing in the Flutter community. Check out the examples and esp. the TodoMVC demo, they cover quite a bit of ground.
I can confirm the experience and I've used dart on multi month projects twice now : first time when it was the JS replacement and using AngularDart back in the angular 2 beta days - it was ahead of the curve at the time with tooling (compared to JS world), but it went nowhere because of poor design choices.
Then they decided to salvage the team and made flutter with it - the technical reasons of chosing it over JS sound extremely unconvincing. And the language is as you say the worst of both worlds - verbose and weak type system (I remember getting runtime type exceptions because compiler couldn't catch a type mismatch in a ternary) and none of JS dynamism, no reflection - just boilerplate on top of boilerplate.
Worst part is the react like architecture of flutter lends itself really well to immutable state management practices but the language is so weak that any immutable library involves a ton of ugly boilerplate - and they refuse to add stuff like records to the language to ameliorate the problem.
The reason it gets me so riled up to rant is that the framework itself and the idea behind it (custom native rendering framework) has potential - but dart makes using it horrible.
I mean they basically have a single purpose programming language (AFAIK Flutter is the only relevant use case) and it is taking them years to add ergonomic improvements to the language that would make day to day dev much easier.
Meanwhile they spent colossal effort and broke half of community packages (including a bunch of first party ones) with null safety. I'd say go for low hanging fruit first.
Because the language is so limited it's impossible to solve this via library, unlike say JavaScript.
This reminds me so much of the ClojureScript "win". I love that JS is rounding into shape as a serious language, but the version turmoil! CLJS was "done" when it came out, so the CLJS developer is insulated from any churn.
I know little about Dart/Flutter history, but it sounds like ClojureDart might do a lot for Flutter development if only for CLJD's stability.
I'd rather take sound null safety over records. To say it's taking them years is disingenuous when they've mainly been working on null safety all this time, not twiddling their thumbs.
Oh this totally reminds me of the BLoC pattern[0][1] that everyone kind of... really gritted their teeth through. It just wasn't at all an appealing way to structure data flow and I was kind of surprised that it was the architectural choice that was being pushed.
90% of the time, it felt like simple IoC plus an app-wide singletons would have been enough for most apps-- trying to get everyone to aadopt BLoC was painful and kinda meh. It's probably just that I never developed a sufficiently big app at scale with lots of devs to see why BLoC was the best way.
That said, I'm also reminded of the Boring Flutter Development Show[2], quite possibly the best produced resource I've ever seen as an intro and ongoing guide to a piece of tech. It is excellent.
Off the top of my head, no access modifiers (so private variables, for example, are prefixed with `_`, by convention, not enforced by the compiler), no pattern matching (and obviously no exhaustive matching), no record types, no sum types, no json (de)serialization (requires 3rd party libary code gen, wow), mutability everywhere, everything is a statement (i.e. no implicit `return`, AKA everything is an expression), required semi-colons (which they'd like to get rid of but can't due to questionable design decisions made long ago -- for the gory details see here[1]).
If you like Java 8 and earlier you'll probably feel at home with Dart.
Obviously I'm biased, but I find Dart to be one of the most unpleasant languages I've had the misfortune of being exposed to; this despite Flutter and its instantaneous hot code reloading being quite amazing -- a bizarre mix of promise and despair.
As a Dart/Flutter outsider myself, I am finding all this "Dart no, Flutter yes" traffic intriguing. I am also a lisper, so no need to sell me on the difficulties of Dart, even if it were the perfect static typed OO, but it sounds like we have a great UI stuck inside an unloved language.
Happy opportunity for ClojureDart!
btw, in case anyone is wondering, I am not a part of Team CLJD at all. My hack is my own separate effort.
That's in no way a bad thing, some may say that means it does one thing (an important thing) extremely well ;)
I switched from a purely TS/JS stack (React-Native-Web to cover iOS/Android/Web, Typescript on the backend, with some stuff to share types), and just got way too tired of all the tooling, the configuration, etc.
While I use Golang on the backend (compiled to WASM for serverless) I wouldn't be against using Dart on the backend if it had a WASM compiler...
It does predate Flutter by five or so years but I do agree that it doesn't have much of a reason to exist outside of that now. I would love to have been a fly on the wall when the decision was made to choose Dart.
Didn't it have something to do with Dart being pushed as Google's pet language? I have heard arguments that it was chosen because TS is Microsoft's pet, while Oracle was having a picnic with Java (this was around the time of the Google-Oracle saga). Dart was seen as a way for Google to be independent of both, and Kotlin wasn't developed yet at the time, hence Flutter went with Dart.
Dart was being pushed as JavaScript replacement, back when everyone had one.
However Chrome team failed to push ChromiumVM and eventually the project was ramped down, by then AdWords had made a massive investment moving from GWT into AngularDart, so they rescued the project.
Eventually Flutter, initally prototyped in JavaScript, moved into Dart, and they also decided to change the language semantics from dynamic language with gradual typing (Dart 1.x), to static typing with type inference (Dart 2.0).
Somewhere alongside this timeline, many well known names from language design like Gilad Bracha and Kasper Lund, well known for favouring dynamic languages, left the project.
Kasper Lund's latest project, is not surprising also a dynamic language, https://toit.io/
Do you know what is the relationship between Dart/Flutter and Kotlin? On paper, it seems that Dart/Flutter is a better choice in the context of mobile dev because it is cross platform. If I were to focus on Android exclusively, would Kotlin offer any advantages over Dart/Flutter?
I guess I am trying to understand why these two coexist, which one to learn, and how likely it is that Google will kill Dart/Flutter in the next 5-10 years.
Politics, go to Android SDK site, you will hardly find anything related to Flutter.
It is all about Java, Kotlin, C, C++, Web widgets and PWAs.
I am not a big Kotlin fan, the way Android has pushed it using their Android Java as counter example instead of supporting modern Java, however as JVM language it definitely has a broader industry support than Dart.
Just to add on, Kotlin also does have some (limited) multi-platform features, with potential to build on for more.
Honestly, Flutter is an amazing framework conceptually, but Dart may prove to be its demise. I just hope there is a possibility for Flutter based on Typescript or Kotlin in the future.
That is impossible, because Flutter is written in Dart on top of Skia, most Dart 2.0 features have been done to improve that development experience, using any other language means basically a full rewrite.
I know that.... But apparently with all the issues Flutter has, there is a possibility that a full rewrite will be absolutely necessary to rectify them.
cough Well, this article _is_ about a delightful Lispy alternative to Dart that compiles to Dart, yielding a superior language with Genuine Dart Inside(tm) and elegant support of Flutter.
Dart may end up living on inside ClojureDart, much like DOS living on deep inside Windows and PCs.