7 ms·
That's really helpful. Thanks. I have another question. C++ already has types, a main function, collections etc. and is really fast. What are the advantages of
by phloxicon 12y ago
That's really helpful. Thanks.
I have another question. C++ already has types, a main function, collections etc. and is really fast. What are the advantages of Dart over C++ with emscripten?
- spankalee 12y agoDart is much more of a scripting language than C++. It makes as many code issues static warnings and runtime errors as it can, rather than runtime errors, so you can run a partially incorrect program. Dart is also strongly typed, doesn't have pointers, has GC, has no shared-memory concurrency, uses dynamic dispatch, don't require a compiler (for development), has full access the the DOM (with a much nicer API than in JavaScript!)...
- k__ 12y agoIsn't the the API specified by the DOM? Like, when I use DOM in any language, it will be conform the the DOM spec, like having the same classes, methods, etc.?
- tosh 12y agoDart's DOM API is way nicer than the one from JavaScript since the Dart team had the ability to re-think naming & structure. This article has a nice summary of the improvements https://www.dartlang.org/articles/improving-the-dom/ https://www.dartlang.org/articles/improving-the-dom/
- spankalee 12y agoAlmost, but we have made it better. For instance, rather than use callbacks everywhere, most of our async APIs return Futures and Streams. All the "Array like objects", like NodeList, are actually lists in Dart. You can iterate over them and modify them list any other list. element.classses.add('foo') works, as well as some jQuery-isms like element.classes.toggle('foo', show). setInterval is replaced with the standard dart:async Timer class. There is a ton of cleanup in the dart:html library that makes programming the DOM nice. I'd say there will never need to be a jQuery equivalent in Dart.
- tkinom 12y ago"There will never need to be a jQuery equivalent in Dart." You should read the "Criticism" part of this page. http://en.wikipedia.org/wiki/Dart_%28programming_language%29 http://en.wikipedia.org/wiki/Dart_%28programming_language%29 Apple, FF, MS are all against Dart. Google "percentage of website power by Jquery" and tell us how are you going to convince 50% of websites to abandon JQuery and use dart. Dart today = GWT of yesterday!!!
- WoodenChair 12y agoThat's such a straw man argument. It's 1995 - how are you going to convince 50% of C++ developers to give Java a chance?
- orbifold 12y agoYou don't, instead you use your existing connections with corporate management and your massive advertising budget to convince managers to force developers to use it. Even if they are perfectly fine using C++ or Smalltalk.
- k__ 12y agoI still can't understand why they prefered Java over Smalltalk...
- orbifold 12y agoWell it was clear that since Java was statically typed, it would be possible to write a faster VM for it eventually. And Sun bought up the startup that was implementing Strongtalk, an actual improvement over the bad performance of Smalltalk consumer hardware.
- spankalee 12y agoI'm familiar with the criticisms, what about them? The have nothing to do with DOM APIs.