Comment by qop
8 years ago
Dart is an incredible achievement in terms of type systems tech. Gilad is a major inspiration for me. Great guy.
Idk whose "side" I'm on here, but I didn't want to lose an opportunity to blurt out my love.
It's a shame dart is being managed by google. I wish they had been more hands off with the dart team, as they are deviating from server-side go so people can write mobile apps in dart. Even though they'll look almost exactly like C# apps but with better types...
Anyways yeah. Dart. Cool types. Good vm. Gilad is a cool guy.
Can you explain why you think the type system in Dart is great (or point me to something on the web that does this) -- AFAIK, that has never been made a selling point of the language.
(I have been considering Dart for a while, but haven't taken the time to look into it because it doesn't seem like it provides additional benefits compared to other languages (apart from the Flutter aspect).)
So dart has the concept of gradual typing, where some portion of the program is annotated and the rest is not. I'm not completely up to date on current dart, but for some time there was the concept of checked compilation sms unchecked. Now I think it's called strong mode.
Anyways, you could check for certain major structural errors in unchecked mode and compile very fast, and then when it's time to start propping up a release, you can turn on checked mode and catch more intricate errors.
Gilad has been working on gradual/optional type systems for years. (they are technically two different ideas but the difference is rather academic and of little use to most programmers)
Anyways, dart has strong generics, it can do contravariance easily which makes refactoring code without breaking existing call sites, the dart lang spec has a great section on this.
In addition to all this, dart has really good reflection support through mirrors, a concept I'm not very familiar with, but it makes possible a tool called observatory, which is awesome. You can have source maps for dart2js, you can see which individual classes or methods or even lines of code are being utilized, you can get a lot visualizations about your performance profile, you can look at dart from the inside of dart. It's a lot like smalltalk, but way more practical.
Sort of like how rails took a perfectly good language and destroyed it, flutter seems to have built a foundation for taking dart and exploiting it.
Now they say its client-oriented" which I assume is googlese for "if you're not using dart for flutter, fuck off."
There was also a dart llvm effort at one point, but that became too useful and was abandoned.
If you are looking for a really good functional language for web, consider F# if you have dotnet experience, or bucklescript if you have ocaml support, scalajs if you have jvm experience and also love shitty tooling, and finally, purescript if you like haskell.
HN likes Elm a lot, but it's a little too opinionated for me, and although I like the BDFL approach to FOSS, it doesn't mean that you should be the ONLY developer in the core. That makes me exceptionally nervous about adoption, especially for professional work.
YouTube search for "gilad is right" for some talks that he's given. There's one where he dives in depth to the type system and how checking works.
Sorry for no links, literally using 2G right now, travelling.
Thanks for the extended explanation. Lots of things to chew on.
Yeah, I am unhappy that they are focusing Dart more on the client side (another reason, I didn't look too closely at it) -- focus like that is probably good for language adoption in some niche, but it would be nice to have a good strongly typed language that also has good support, good tooling and extensive libraries for use both on the client side and the server side (and for mobile app development!) so you have only one language to deal with everywhere. Dart is one of the few languages that from the outside seems closest to that ideal.
1 reply →
You will probably be disappointed to know that dart is fully statically typed now (with type inference). Still a good language but missing it's dynamic soul. I too thought that gradual typing was a perfect balance.
3 replies →