6 ms·
From the (incomplete) overview here (and ignoring the type system for the moment), Dart appears to be reasonably competent and technically sound, given that thi
by kibwen 15y ago
From the (incomplete) overview here (and ignoring the type system for the moment), Dart appears to be reasonably competent and technically sound, given that this is a language intended to compile to Javascript. That said, it doesn't terribly excite me.
It should be interesting to see whether the safety guarantees of optional typing and the few other restrictions it provides (such as more rigid function signatures) will really entice developers who are planning large web applications. I'm working on a modest-sized (~3kloc) Javascript codebase at the moment and it's somewhat of a mess, but that's really more due to the combined influence of legacy code, time constraints, technical debt, rapidly shifting requirements, and a lack of testing. Other than that last point, it's not immediately obvious how using Dart rather than Javascript would have benefited me. Perhaps someone who's worked with a more substantial Javascript application could provide a better answer.
- mmurph211 15y agoI think it's good to have a choice of language for front end web development and I think primarily this is what Dart is providing. That said unless Dart proves to be considerably faster than Javascript I don't think I'll be converting any old Javascript code bases. I agree they're certainly going to have to provide a convincing case for me to switch to Dart in the future but like I said right now it's at least nice to see a second choice being developed.
- beza1e1 15y agoDart is not "intended to compile to Javascript". Dart is intended to compete with Javascript. Compiling to Javascript is just intended as a fallback.
- firefoxman1 15y agoThis has probably been asked before, but why haven't any browsers worked on natively implementing CoffeeScript (not compiling to Javascript first)?
- gcp 15y agoBecause there is no advantage to that at all? Dart has more type information, so a Dart compiler has some hints to generate faster code. (And this is why fast JavaScript engines do type inference)
- firefoxman1 15y agoWell, I mean, if you're going to try to change the web's language, why not use a well-thought-out and already widely-used language? Are there so many flaws in CoffeeScript that Google needed to write yet another language?
- kibwen 15y agoIt would be a lot of work for very little benefit, given that CS already compiles to Javascript with very little (or none, or negative) overhead. However, in Firefox at least, there are some tentative plans to make debugging transpiled Javascript easier by adding support for identifying the location of the runtime errors in the original source file[1]. I haven't checked, but perhaps there exist addons to allow Firefox's Javascript console to execute CS natively. Other than these two features, I'm not sure what more you could ask for regarding browser support. [1] https://wiki.mozilla.org/DevTools/Features/SourceMap https://wiki.mozilla.org/DevTools/Features/SourceMap
- kibwen 15y agoThis is true, and I should have chosen my words better. My intended point, however, was that unless Google is attempting to deliberately sabotage the performance of Javascript-compiled Dart applications, there are practical limits to what they can achieve via translation (or so I assume, correct me if this is misguided).
- spankalee 15y agoI think you're wrong here. Being able to compile to Javascript with good performance is a primary design goal. Of course, there's no reason a language can't both compete with and compile to Javascript, like CoffeeScript for example.
- tomp 15y ago> Dart appears to be reasonably competent and technically sound Really? I got exactly the opposite impression. All types are nullable (lack of null safety). Why are they using a type (String) for a constant (''final'' variable)? Mixing up lists and arrays. There is a separate string builder class ''StringBuffer'' (which does not share the interface with ''String'', I don't know why not, while ''int'' and ''double'' are unified under the interface ''num'') that doesn't really work. You can't iterate over maps using the ''for...in'' syntax (at least the overview does not mention it). This document, to me, screams of technical incompetency, or at least of language design from 10 years ago. There are also some other weird design choices, like optional non-typing (i.e. there are no safety guarantees, types are not enforced), all values but ''true'' are ''false'' (this feature might turn out to actually be useful, but as far as I understand, they want to force people to write proper boolean tests in if statements - why then even allow non-boolean values in boolean contexts?). The ''[x = 1]'' syntax for parameters with default value is really weird, I guess its purpose is to be consistent with the optional argument syntax, but why not just copy what Python does, with all parameters with default values be optional, and you can always set it to ''null'' yourself, if you want... Julia, for me, is a recent language that is really well designed!
- kibwen 15y agoI said "ignoring the type system for the moment" specifically because I wanted to exclude the type system from the following observation, since I don't have the type-theoretical background necessary to make a proper critique (and people far more intelligent than me have already bemoaned it[1]). I agree that Dart's features seem sort of "stale" (or perhaps "safe" would be a less inflammatory word). Language design from 10 years ago indeed, although it's still a young language, so I'm willing to give it time to evolve. In my defense, "reasonably competent" wasn't exactly intended as praise. I do have issues with the things presented in the overview, but at the time I wrote that comment there were no other comments on this article, and I felt that I'd be wasting my time by enumerating them. :P [1] http://lambda-the-ultimate.org/node/4377 http://lambda-the-ultimate.org/node/4377
- dchest 15y agoWhy are they using a type (String) for a constant (''final'' variable)? It's not a constant. Is a variable that contains a value of string type that cannot be assigned to anymore. "String" is an annotation for variable, not for the value. There is a separate string builder class ''StringBuffer'' (which does not share the interface with ''String'', I don't know why not, Because string values are immutable, they can't be concatenated without lots of allocations. StringBuffer solves this. This document, to me, screams of technical incompetency, or at least of language design from 10 years ago. This is probably because you didn't think out the various trade-offs and design decisions, of which Dart creators thought.
- riffraff 15y agoone selling point of Dart would be tooling and IDE support: I guess what you could be hoping are great refactoring tools.
- bradleyjg 15y agoIt will depend on how much effort google puts into making really great libraries, frameworks and tools for the language. There are starting from way behind, because javascript has a wide range of good libraries, several decent frameworks and a few okay tools. Dart has virtually nothing. Google's thousands of really great developers, could build out a first rate, albeit single party, ecosystem. It remains to be seen if they will.