by simplify · 7y ago · 0 comments
Dart is a pain to work with. But to be honest, Flutter makes it worth putting up with.
I'd love for Standard ML to become popular as it offers all the things in a pragmatic package. The ML languages (and their hindley-milner roots) have sat around for over 45 years without being adopted into the mainstream. At some point you have to admit that the world isn't ready for a great language yet and go with something that is a step in the right direction.
If I have to use a lowest-common-denominator language, I'll take Dart over Java any day. The syntax is better, first-class functions with closures are far superior to anything Java offers, decent type inference, etc are all steps closer to SML and make life easier.
Even comparing with Java 8, dart syntax is much better IMO. Java 8 type inference gets better, but still not as good (Java 10 looks to be getting closer).
Java 8 type inference gets better, but still not as good (Java 10 looks to be getting closer). Java lambdas are a joke compared to Dart. This stems from functions being first-class in Dart, but being second-class citizens in Java. Dart can handle a much more functional programming approach much more easily than Java.
Java closures only work with final variables while dart works with all enclosed variables. In Java, if I want a function to accept another function, I have to explicitly say that I accept a Lambda because Lambdas are special cases. With dart, I can accept any function that matches my expected types because functions are first-class. Another big difference is that Dart functions can be top-level. If I need a one-off function somewhere, I don't need to pack it in a class. I just make it and use it.
I also prefer Dart syntax because of things like private variables, implicit setters/getters, named parameters, async/await, no need for `new` keyword everywhere, implicit interfaces, generators, etc.
And if we get started on supported OSes, available libraries, modelling tools, industrial vendor and IDE support, then it is a non-starter.
This putting aside that Kotlin, Scala, Common Lisp and Clojure are also options on the JVM.