Better HN
topnewbestaskshowjobs
Log inSign up

fmuaddib

5 karma · joined Aug 13, 2014 (12y ago) · 2 submissions

Submissions

comment 12y ago · link · parent

I'm working on my first Dart web project since february. I'd say that the thing that really makes a difference in Dart compared to javascript is the Dart Analyzer. Thanks to the Analyzer the code is type checked and syntax corrected while you are writing and this prevents 90% of bugs otherwise very common and time consuming in javascript. And this while keeping all the flexibility of a dynamically typed language like javascript. Also a great boost in productivity comes from the fact that the Dart framework already incorporates all features that in javascript require dozens of external libraries like jquery, node.js or modernizr, etc. Porting legacy javascript code in Dart is also very easy, the syntax is almost identical. I think if you do not have to use advanced libraries like Polymer.Dart or Angular.Dart (they are much better than the javascript counterparts, but currently are still very buggy and not production ready), then you can use Dart today and get a boost in productivity. When the DartVM will be incorporated in Chrome (currently its only available in the Chromium/Dartium version of the browser) that should also give up to 4x performance improvement over javascript. That is expected for the next year, when the new "Oilpan" garbage collector will be finally integrated into Chrome.

comment 12y ago · link · parent

I'm being using Dart for months now and I think people will soon realize that it deserves to be the next javascript.

Here is what Dart really is: Node.js without the JavaScript baggage — I like Node.js because of the principles on which it was built: run things asynchronously whenever possible, use data streams whenever you can get away with it, and tie it all together with futures and callbacks. The problem with Node.js is that it’s JavaScript. There’s no distinction between types of numbers, working with arrays is always janky, NaN-infused wat moments abound, and so on.

But Dart gives you everything that’s great about Node.js without the baggage of JavaScript clinging to the project like a nagging, alcoholic in-law. Dart has an incredibly robust stream API and top-notch futures support baked into the core dart:async library, plus a bunch of other stuff that you get for free, like WebSockets, SSL support, a decent math library (complete with ints, nums, and doubles out of the box), as well as the foundations for an Erlang-flavored actor system in the dart:isolate library.

Basically, server-side Dart is trying to solve the same problems that Node.js was built to solve, i.e. problems around asynchronous, non-blocking I/O, but is doing so on a better VM and with a more robust and less flaky language. Another bit of good news is that Dart in practice is highly reminiscent of JavaScript, from the basic syntax to callback functions as first-class citizens, which means that the bridge from Node.js to Dart isn’t a terribly precarious one.