4 ms·
What's the killer feature of dart? I went through some docs and couldn't see anything JavaScript doesn't already have or is soon to have.
by scotty79 12y ago
What's the killer feature of dart? I went through some docs and couldn't see anything JavaScript doesn't already have or is soon to have.
- CmonDev 12y agoProper OOP and type checking. Fighting to finally make the web open. Open to new languages, technologies and innovation. All we have now is legacy stuff like JS and HTML. I hope NaCl will also start dominating at some point. Freedom of choice of tools is important.
- pjmlp 12y agoApps will free us.
- pjmlp 12y agoIf Google had done this right with the other vendors, it would have been the second coming of Smalltalk in a way. As the developer experience is somehow similar. As it is, it is just another language that transpiles to JavaScript.
- chewxy 12y agoOptional typing is pretty interesting, IMO. I'm not sure if that is a killer feature for programmers who are used to JS dev tho
- yulaow 12y agoIt will be supported only on chrome while any other browser will ignore it. It remember me of Jscript or Vbscript, what a vibrant future /s
- marcell 12y agoLooking at the slides, I don't think this is accurate. You can compile Dart into Javascript, which will run on non-Chrome browsers. The advantage is that (1) on Chrome, you get better performance, and (2) you get a nicer language that Javascript.
- yulaow 12y agoAnd now I have to support (and debug) two languages only because on a single browser one can perform slightly better, while the rest of the resources and frameworks for web clients are all written in javascript. No thanks
- WoodenChair 12y agoWhy would you be supporting two languages? You can choose to write your app in JavaScript (that's not going away and that's one language) or you can choose to write your app in Dart (also just one language) which will run as Dart on the Dart VM and compiled-you-don't-touch-it JavaScript everywhere else. Sounds like FUD to me.
- yulaow 12y agoBecause if I choose dart I have still to deal with the derived javascript code implementation I must use to run in other browser that are not chrome and, as described by the post close to this, often that js is so broken it cause big bugs on firefox for example, and to understand and repair those you have to know js.
- WoodenChair 12y agoI would take what kevingadd says with a grain of salt. He's the author of a .NET -> JS compiler (arguably a competitor to Dart) and the experience he cites below is pretty different from what I've had and my colleagues have had. I don't mean that as character assassination - he's obviously a very talented developer - but rather as a point of contrast. Frankly, you would not want to be touching the compiled JavaScript from Dart - it's not meant to be changed. I agree that if it's that broken, then you should certainly not use the platform. So you should just be writing in JavaScript or just be writing in Dart.
- kevingadd 12y agoDart is presently broken by design for web browsers in general, because they have to ship a set of type mapping tables that contains names & information specific to individual browser versions. In the past, new releases of Firefox have broken it and those errors had to be pointed out to the dev team for a later fix. Ideally in the future the Dart team will be more on top of things, but you will still have to recompile your Dart applications every time a new browser comes out. Many developers will probably not remember to do this - if they're maintaining their apps at all. Dart2js is also an afterthought (in general) compared to the mainline dart vm, so it will be possible (if not common) for dart applications to end up only being compatible with Chrome's implementation. One of the main issues I'm aware of in this area is that integers larger than 53-bit will silently fail to work correctly, while native Dart will handle them.
- WoodenChair 12y agoThere's not just one killer feature. Here's a few strong features that add up: - optional static type annotations - advanced object-oriented features (mixins, advanced constructors, etc) - rich built-in libraries - pub package manager - 2X V8 performance w/ the Dart VM - integrated tooling - exceptions - generics - operator overloading... I could go on, but basically I'm not sure what language you were looking at because Dart has a lot that plain vanilla JavaScript does not (although can have with extensions). It also doesn't inherit all of those flaws JavaScript got from being designed in a time crunch (10 days is really not enough time to design a language). If I had to pick one though, it would probably be the fact that Dart is a platform (rich language, libraries, tools, and package manager) rather than hodge podge of frameworks on top of a lightweight language.
- ajizzle 12y agoIf it compiles down to javascript then it does have the same flaws as javascript. 2x performance of v8 is bullshit, and "rich built-in libraries" and "integrated tooling" are just marketing drabble. If you understand what they actually mean please explain or gtfo.
- WoodenChair 12y agoSure, I'll explain each one. Performance - Dart has its own VM which runs independently (on the server, or in special builds of Chrome, but soon to be mainline Chrome). So it's not just a language that trans-compiles to JavaScript, it's also a language with its own independent high performance VM that you can use on the server today and the browser tomorrow (hopefully). By the way the Dart VM was written by the same guys that created V8 - generally considered to be one of the highest performance JavaScript VMs - so I think we can believe them when they say it's higher performing. Rich Built-in Libraries - Just take a look here: https://api.dartlang.org/ https://api.dartlang.org/ There's everything from a reflections API to a WebGL library. There's JavaScript interop libraries, concurrency libraries, and the equivalent of jQuery built-in. That's just scratching the surface. Integrated Tooling - Dart has its own package manager (pub) which is quite nice as well as its own IDE (Dart Editor) which comes with a debugger, profiler, and all the niceties you'd expect (code completion, deployment help, etc). It's also a new language (less than a year since 1.0) backed by a big company so these things are only going to continue to improve.
- skrebbel 12y agoIt's tool support and unsurprising semantics. Few other web frontend languages have that. TypeScript comes close with the tool support, but it doesn't have the unsurprising semantics, and all in all it's a lot more limited, because it's designed to be a near-superset of JavaScript. I'd be using Dart already if it was simpler to integrate with existing JS libraries. That's the part TypeScript got way better. Tool support must be one of the most underrated language features these days. The enormity of blog posts about desiging your ruby code for "greppability" is just scary - I just want my tool to generate a call hierarchy for me, thank you. Dart has this covered.
- mpweiher 12y agoSemantically, Dart is pretty much Smalltalk, so it's actually a useful, reasonably well-thought-out language with sane semantics. A bit of a shame about the syntax... It even has doesNotUnderstand:, so it's quite extensible. The optional typing is neat: you can have a type error and the program won't just compile, it will continue to run! There's a video of Gilad demonstrating this in a live coding environment: he changes the type of a variable that's a number to String and apart from the compiler now complaining, nothing changes. The isolates concept also seems well-thought out, with separate heaps and the only interaction via messaging. Nothing breathtakingly new, but I think they picked up the right thing and implemented it well. The fact that the semantics are sane means the compiler can create faster code than JS with fewer heroics (if it isn't compiled via JS).