4 ms·
Maybe I'm missing something big but Dart looks to me like Slightly Better Java, yet another boring incremental improvement on languages that are well past their
by svachalek 14y ago
Maybe I'm missing something big but Dart looks to me like Slightly Better Java, yet another boring incremental improvement on languages that are well past their sell-by date. There are plenty of more daring and yet more mature alternatives that already provide the security of running on a Java or Javascript VM (Scala, CoffeeScript, etc) so I'm really fuzzy on just what they're trying to do here.
- teffen 14y agoWell it's like different, but similar!
- Raphael_Amiard 14y ago> CoffeeScript How is coffeescript 'daring' in any way ? It is a thin veneer on top of javascript, syntactic sugar for your coffee. Dart is a hundred times more daring. It is trying to push optional typing. No mainstream language has such a feature, and not even so much non-mainstream ones. It doesn't say anything about my opinion of any of those two languages (i actually use and like CoffeeScript), but it just sounds to me like you're looking at syntax only, where the important part of a language is its semantics.
- stcredzero 14y ago> Dart is a hundred times more daring. It is trying to push optional typing. No mainstream language has such a feature, and not even so much non-mainstream ones. I long for the day when statically typed/dynamic language debates are considered quaint and old-timey. There was an article posted to HN, where someone instrumented web apps and determined that after some short "warm-up" period, even variables in web apps written in dynamic languages had static types. If a tracing JIT eventually knows what type is in all the variables, why can't we have a development process that uses this information? Isolate all of the "dynamic" code in separate modules marked as such (the JIT could tell us what those sections are) and inject the type information back into the source code. Production servers could keep track of such information over many months, and the developers could know with a high degree of certainty what all the types in all of the variables are.
- Evbn 14y agoClosure Compiler for JS has optional typing.
- azakai 14y ago> How is coffeescript 'daring' in any way ? It is a thin veneer on top of javascript, syntactic sugar for your coffee. CoffeeScript does compile into JS, but so does Dart. Both are in that sense just syntactic sugar. CoffeeScript does make quite big changes to syntax though (often inspired by Ruby, Python, etc.) in many cases more than Dart which seems inspired by Java - and I don't think anyone considers Java 'inspiring' (useful and familiar, sure). > Dart is a hundred times more daring. It is trying to push optional typing. No mainstream language has such a feature, and not even so much non-mainstream ones. ActionScript.
- epidemian 14y ago> ActionScript. And Groovy =D
- Xcelerate 14y ago> CoffeeScript does compile into JS, but so does Dart. Both are in that sense just syntactic sugar. With regards to Dart, that's like saying C++ is just syntactic sugar for assembly. When there's semantic differences between the mapping from one programming domain to another, I would argue that constitutes "compilation". I would agree with the statement for CoffeeScript though.
- batgaijin 14y agoI don't understand, are you saying Dart doesn't compile to JS?
- benmanns 14y agoDart does compile to JS while CoffeeScript retains a one-to-one mapping between CoffeeScript and JavaScript. Read the "golden rule."[0] [0]: http://coffeescript.org/ http://coffeescript.org/
- azakai 14y agoThis is a matter of degree. Dart's types do not affect runtime behavior (at least in the compiled-JS route), so basic types are quite close to JavaScript's, much like CoffeeScript. There are also no features in Dart that cannot be compiled into JS, like say threading with shared state. So overall I think it is reasonable to say that both Dart and CoffeeScript are close to JavaScript and built specifically to compile into it.
- dantheman 14y agoI'm not fully informed about Dart's optional typing, but how is it different from ActionScript 3's optional type system?
- batista 14y ago>Maybe I'm missing something big but Dart looks to me like Slightly Better Java, yet another boring incremental improvement on languages that are well past their sell-by date. It wasn't made to be exciting. For exiting go look elsewhere. It was made for some very pragmatic goals: 1) to be used in the same context as Javascript (web clients mostly but some server too) 2) Look familiar to JS programmers 3) be more like Java and remove the bizarro JS behavior 4) be able to be made faster than V8 5) add some handy stuff to the mix. Exciting does not come into play at all, and with this goals it should not. With "exciting" you get Haskell or Clojure, languages with such small following that they celebrate it with blog posts when they are used by some company (personally, I like both, and they are both better than Dart for tons of things but not for Dart's specific goals). Not that Dart is used by anyone as of now, but one of their goals is to have it be used. And conventional beats "exciting" every time in this goal (All the major used languages: C, C++, Java, JS, Python, Ruby, Perl, C#, all fairly similar and conventional).
- goldfeld 14y agoExcept they are "only" trying to replace perhaps the single most ingrained language of all time, that is, Javascript in browsers. And I'll warrant that the more ingrained a language is, the more it's contender needs to be exciting, and yes, even hyped, and catter to developer motivation and happiness. For pure technical gains, I think there's huge resistance to be found. Having said that, I think they could find some success in, say, making Chrome run Dart natively (as well as Javascript for the time being) and then getting other more hyped languages to compile to Dart.
- batista 14y ago>Except they are "only" trying to replace perhaps the single most ingrained language of all time, that is, Javascript in browsers. And I'll warrant that the more ingrained a language is, the more it's contender needs to be exciting, and yes, even hyped, and catter to developer motivation and happiness. True, they need "hype", but exciting in the way asked above just throws most developers off of it. No exciting language ever gained a stronghold in the market. Even Lisp in the AI/Lisp Machines era and Smalltalk in its heyday were marginal. <b>Having said that, I think they could find some success in, say, making Chrome run Dart natively (as well as Javascript for the time being) and then getting other more hyped languages to compile to Dart.</b> They do have Dart run natively in Dartium, a special Chrome version IIRC. But obviously I can't see Apple/Mozilla/MS playing along and adding Dart to their browsers. One way they could gain ground would be to use the server side advantage (since they want Dart to work on the server too): Make a better Node.js like environment with Dart, with no callback-spaghetti and single-thread issues, and add a top-notch web framework for it, suitable for both Rails and client-rendering style web development. Add MySQL/PostgreSQL and Mongo drivers. I think something like that will catch on like wildfire.
- sethladd 14y agoIf Dart, at first blush, looks familiar, then we've done our job. :) We freely admit that our job was not to make the world's most pure or esoteric language. Dart is a tool to get real jobs done and to be easy to use for a wide range of developers. Our hackathon experience shows that our learning curve is low. That being said, if you poke around and try the language, you'll see quite a few significant improvements and exciting features. I wouldn't say it's "slightly better", I would say there are some significant enhancements. Some significant improvements include: * Isolates for shared-nothing concurrency. Shared-state threads are error prone. * Optional types. You don't always need to prove the entire world is validated by some ceremonial type checker. Web programming especially is a workflow where you want to "write some code, hit reload" and iterate as fast as possible. Also, sometimes you just can't express what you want with your type system. Optional types is a way to say "I was going to cast to Object anyway, so let's dispence with the pleasantries and just use var." * Everything is an object. No more "some things are primitives, some things aren't." * Arbitrarily sized integers. 'nuff said. * Not everything has to be in a class. Dart has top-level functions. This makes utility libraries significantly easier to use. * A package manager as a native part of the ecosystem. This encourages 3rd party developers to share code early. * Significantly faster start up. Go ahead and print out all the classes that are loaded when you run a simple Hello World program with the JVM. We'll wait. :) * (related to the above) All Dart programs actually start running with main(). Turns out, this is not the case in JVM, due to how statics are initialized. * Snapshots. Load code and libraries from a serialized binary heap. Significant startup performance improvements. * Compile-time constants. These are canonicalized, and make for easy way to share data across isolates (they are immutable, for instance). * Named optional parameters, with default values. * All exceptions are uncaught. * Throw any object. So you can throw "This is a crazy one-off error" * Dartdoc comments can have markdown. This is awesome. :) * A file can have a mix of classes and top-level functions. * Lexical closures! (no more need for anonymous inner classes) * Operator overloading. * Method cascades. See http://www.dartlang.org/articles/m1-language-changes/#cascades http://www.dartlang.org/articles/m1-language-changes/#cascad... All that really matters is "Are real developers more productive and having more fun? Are real developers launching more exciting apps?" That is the true test for Dart or any web language. Our experience is that evolutions, not revolutions, are a successful way to adoption. Disclaimer: I'm a long time Java user and I have respect for the platform. I've written books on it, and launched many apps with it.