Dart requires loading a dart runtime js file on to the page, as far as I know. And I think they would claim Typescript is javascript + some extra stuff on top, whereas dart is a whole new language to learn.
No Dart compiles to JS. Obviously there is some overhead with transpiling languages, but it's actually pretty small. They have done a good job with it.
Dart can be run in both modes. Chrome (dunno if enabled by default and/or in stable) contains a Dart VM, so you "only" need to transpile into JS for non-Chrome.
The main problem I had with Dart was [a year ago] that using existing JS libraries like jQuery wasn't as seemless as I would liked. So that would be a reason against Dart, if Angular wants to make that aspect easier.
Haven't looked at TypeScript's interop with JS. I got frightened by the name Microsoft and the fact that they only had a huge language spec PDF and not a single tutorial or something easier to digest.
In production, it's only ever transpiled to JavaScript.
> Chrome (dunno if enabled by default and/or in stable) contains a Dart VM, so you "only" need to transpile into JS for non-Chrome.
Not the real Chrome. A version of Chromium that you can use to make the development cycle smoother. When you deploy, you still transpile to JavaScript for all browsers.
All JavaScript is valid TypeScript. This was one of the founding tenants for TypeScript. So interop is "just use the JS".
You can optionally also provide a binding file that tells TypeScript about the JS code so that it can perform compile-time checking on calls. There is a repository of these bindings for common libraries called DefinitivelyTyped [0].
> ... They only had a huge language spec PDF and not a single tutorial or something easier to digest.
Not sure when you originally looked, but there is now a tutorial [1], handbook [2], and samples [3] in addition to the language spec [4].
Yes Dart compiles to javascript, but it has pretty different semantics from javascript and needs to insert extra javacript to get your transpiled javascript to run. For example, noSuchMethod isn't available in all js engines so using https://www.dartlang.org/articles/emulating-functions/#inter... in dart would require a non-trivial amount of wrapping code to be generated.
I imagine they've improved the runtime size since that stack overflow post was posted a few years ago. However I've never used dart and just tried it out using a basic html sample from the tutorial page and I see:
264 Mar 5 12:21 a.dart
237K Mar 5 12:21 a.js
101K Mar 5 12:22 a.min.js
If you add gzip compression, it's still smaller than doing the same thing with jQuery. "dart:html" provides an idiomatic DOM API where all list-like things are actually Lists, events are streams, Futures instead of callbacks, and so forth. It's pretty nice to use, but it's also one of the bulkier libraries.
Also note that you could now add a thousand lines of code and the file size wouldn't increase much. You already paid that one-time cost.
You can further improve the size by using a better minifier on top of --minify.
Ah, that makes sense re:same size as if you added jquery, and the API abstractions do sound better.
Though as a counterpoint (and relevant to angular 2 :) I read they're going to just use the raw dom api's instead of a jquery/jquery-lite abstraction layer as the dom api's don't need the smoothing over in modern browsers like they used to.