Skip to main content

Posts

Showing posts with the label dart2js

New site for Dart news and articles

For the latest Dart news, visit our new blog at  https://medium.com/dartlang .

Why dart2js produces faster JavaScript code from Dart

The dart2js compiler, which converts Dart to JavaScript, now produces smaller and faster code thanks to its global type inferencer. By analyzing the entire program, the compiler can eliminate bailouts and redundant checks, resulting in code that runs faster on modern JavaScript engines. As evidenced by the graph below, the performance of the code generated by dart2js (the purple line) now slightly outperforms the original hand-written benchmark code (the gold line). The Dart VM, which natively runs Dart code, is the top line. High is better in this benchmark ( Dart code , JavaScript code ). Taken on 2012/03/28. From dartlang.org/performance Type inferencing helps performance Nicolas Geoffray, engineer on dart2js, has been working on the beginnings of the global type inferencer. In a recent interview ( video ) he showed examples of the original Dart code, the previously generated JavaScript code, and the new more optimized JavaScript code. Code gets smaller, faster Fo...

Dart Milestone 2 Brings Smaller JavaScript Output and Package Uploads to Pub

Anders Sandholm gives us some of the details  of the Milestone 2 (M2) release : We’re happy to announce the next milestone of the Dart project - M2. The bits for the editor and SDK are available at dartlang.org . A few features you may like in this release: Significantly smaller generated JavaScript from dart2js due to tree-shaking of the html libraries and general minification.  Tree-shaking is on by default. Minification requires the command line flag --minify .  As a result, the generated code for swarm is now only half the size compared to M1. Support for uploading of user packages to pub . The M3 release will focus on core library cleanup and the new streaming API for asynchronous communication. We’re looking forward to your feedback and thanks for your support. As always, we invite you to join our  Dart mailing list , ask questions on  Stack Overflow , or file feature requests on  dartbug.com .

Breaking Change: Deprecated Language Features Will No Longer be Supported by Dart2js

Peter von der Ahé  writes : dart2js will soon start rejecting code that uses certain  deprecated language features.  Right now, the compiler is warning   about these language features, but it will soon reject code that uses  them.  The compiler, dart2js, will soon start rejecting the following  deprecated language features:  * Interface declarations.  Use abstract classes instead.  * Getters with explicit parameter lists "()".  Just remove the parentheses.  * Old-style #library, #import, and #source syntax.  Convert to new-style syntax:      #library('foo');      becomes:      library foo;      #source('foo.dart');      becomes:      part 'foo.dart';      #import('foolib.dart', prefix: 'foo');      becomes:      import 'foolib.dart' as foo;  ...

Dart Team Updates, Oct 30 - Nov 13

The Dart team has been busy. Anders Sandholm  writes : On Dart  core libraries  we've introduced a library fork in experimental/lib_v2. Discussions and prototypes on Streams (called “Observable” in C#). Started work on refactoring the collections library. (Almost) removed library core_impl. noSuchMethod now takes an InvocationMirror. In the  dart:io  library, we've implemented HTTP session and HTTP basic authentication support. We fixed bugs in the HTTP library and fixed a bug that caused Pub to fail (because of accessing files open in other processes on Windows). We're also working on improving IO performance and started landing HTTPS support. For  dart:html , we now have implementations and interfaces merged, dart:svg is split from dart:html and there's new support for keycodes. In the  Dart VM , the GC is now collecting unreferenced compiled code to avoid running out of code heap. The compiler now has bounds check elimination for some ar...