I took easily to Dart because it reminded me a lot of my favorite
desktop-development language and component-set (*Delphi*), therefor I was
entertained to see *Anders Hejlsberg* presenting TypeScript since he was
instrumental in designing Delphi. And, of course he helped make C# look
quite a bit like Delphi... so, now it is time to make JS code a bit more
Delphi-like?
Now that *Dart gives me a lot more of what modern Delphi offers* (generics,
collections, operating overloading, a pretty clean type system nice
inheritance, etc) than TypeScript (currently) does, why would I want to use
TypeScript? The simple fact is that the Dart team could make a
Dart-2-TypeScript compiler if TypeScript "took off", but the real solution
is clearly for ES6 to adopt a proper, modern, class/object based approach
to development. The reason I came to Dart is that I detest JS and its
horrendous prototypical-inheritance, etc, for all but the simplest of
needs. *Dart saved me from JS hell!* Thank you Dart team! I watched a lot
of A.H.'s video, and I don't recall him ever mentioning "Dart", even as it
is quite obvious that MS is addressing the same perceived need that Dart is
and that Dart is likely a huge motivator for TypeScript. Thank you Dart!
*I generally agree with Bob N.'s list of Dart qualities* worth mentioning,
though I do not (currently) fully agree with his "A cleaner DOM API"
statement due to the fact that the Dart-based DOM abstraction is causing me
multiple problems that I do/did not experience with JS: that is, the Dart
"wrapping" of the DOM has hidden access to setting namespaces on elements
(which is *required* for certain SVG needs, as reported in various issues I
have submitted: #2977, #5395, #5526) and has introduced varying behavior
between HTML-wrapped SVG vs standalone-SVG files (something I do not
experience when writing native JS code -- the ElementImplementation
structures in Dart are screwing things up in this regard). I also find the
DOM API within Dart to be a bit "over-engineered" with regards to making
some things that *should* be able to complete quite fast and synchronously
instead become an asynchronous mess of convolution and complication,
like: Future<ElementRect> for documentElement/viewportElement.rect.
Seriously, who thought this up? It makes the execution-flow through
applications really difficult to manage. So, *a "cleaner API" is one
thing, but if I encounter regressions and/or complications that JS's view
of the DOM didn't throw into the mix, then "cleaner" doesn't mean that much
to me*.
So, from where *I* sit, and based on how I am currently using Dart, *I see
Dart as a very promising development language (that reminds me a lot of
Delphi)* layered over a somewhat overly-complex/buggy-implementation of
interacting with the SVG DOM that I expect I would *not* experience using
TypeScript (since it does not try to "improve the DOM" per se). But, I
have hopes that someone will eventually fix the DOM issues I
am encountering within the Dart framework and give me a reason to stick
with Dart (vs. TypeScript perhaps). If not, *I would bet that Anders H. /
Microsoft is going to move JS in the proper direction and, with time, I
expect MS will evolve their TypeScript to include much of what Dart offers
already.*
I personally don't care if the Dart VM remains "only within Chrome" either,
since I am looking at Dart/Dartium as a *business-applications* platform
where I can tell my users/clients that "this app requires Dart/Chrome" or
whatever. Big deal. So, *browser-adoption of the Dart-VM is not what is
going to be the deciding factor for me*, but instead: speed of application
development, ease of maintainability, execution-speed (to some degree), and
maximum code-re-use. I guess time will tell whether Dart or TypeScript is
the "right" approach; it is simply too bad that both could not just team up
to make a common modern EcmaScript alternative that just happened to look a
lot like Dart.
Post by Kevin Moorehttp://www.typescriptlang.org/
TypeScript is a language for application-scale JavaScript development.
TypeScript is a typed superset of JavaScript that compiles to plain
JavaScript.
Any browser. Any host. Any OS. Open Source.
--
Consider asking HOWTO questions at Stack Overflow: http://stackoverflow.com/tags/dart