Profile cover photo
Profile photo
Anders Johnsen
Anders's posts

Post has shared content
I want to take the wrappers off Dart Pad, a browser-based Dart experience that +Luke Church and I have been working on. We like to think about it as a language playground; it can be used by new developers to have fun learning Dart, and by experienced Dart developers to quickly experiment with new ideas. Developers get live code analysis feedback and can see the code run right in their browser.

If you're on a laptop, check it out at If you're on a mobile device, try

Dart Pad is in beta; feedback welcome (! Some of our plans for future iterations include:

- improved support for sharing, via Github’s gists
- support for package: references
- merging the mobile and desktop UIs into one, material design based UI
- improved API exploration via integrated code completion and dartdoc documentation

Thanks for kicking the tires!

Post has shared content
Shoutout to +Jakob G! Thanks to his efforts while interning in Aarhus, the 1.9 release of the Dart VM includes a port of V8’s Irregexp Engine for regular expressions making your regular expressions up to 150 times faster than before! We chose to take a different approach to integrating the Irregexp Engine: reuse Dart’s existing optimizing compiler and code-generation backend. This reuse helps reduce maintenance cost and share optimization efforts: optimizations for Dart will benefit regular expressions and vice versa.

In V8, Irregexp compiles a regular expression by parsing it and converting it into an intermediate automaton representation, which V8 then analyzes, optimizes and finally directly generates native machine code. The V8 implementation requires a native-code backend for each supported host architecture. Indeed, at the time of writing V8 has 7 distinct Irregexp backends. 

In Dart, Irregexp initially compiles a regular expression, just as in V8, by parsing, converting, analyzing and optimizing it. Finally Dart generates IR (intermediate representation) instructions. This IR is the same representation used for ordinary Dart code and so we use the existing Dart optimizing compiler to further optimize the code and generate native machine code.

The Dart implementation has been tested against the same benchmark suite as developed for V8’s Irregexp. Here, the Dart VM is within a factor of two from V8. For short-running regular expressions, such as parsing URLs, Dart is actually faster due to a very fast entry to the generated matching code. 

There are several reasons we don’t hit the same peak performance as V8 across the board. For example, Dart spends more time on compiling regular expressions because, after building the Dart IR, we further optimize the code. Also, V8’s hand-tuned machine-code backends are expertly tailored to executing regular-expression code on each individual platform. The machine code Dart produces is not as efficient because the existing optimizing compiler can’t make the same assumptions about properties of the code (such as what to hold in registers and what not to). We will be looking at these issues, and due to the single shared Dart backend, improvements become improvements to the Dart VM as a whole.

We hope you enjoy Dart's new and improved regular expressions. Look for the new implementation starting with Dart 1.9, which is now in the developer channel.

Post has attachment
Some technical information about the changes we did for Dart 1.3, to improve server-side performance:

* The HTTP stack, which is written in Dart, was reworked to take advantage of the Dart VM's generational garbage collector[1]. For example, short-lived objects are very cheap to collect, so we now allocate new buffers frequently, instead of reusing buffers.

* On Linux and Mac, we reduced the number of required system calls for asynchronous I/O, which significantly reduced I/O latency. This was accomplished by moving from a combined pull and push based I/O event model, to an entirely push based solution where the OS is responsible for emitting all I/O events.

* We profiled profiled some server-side applications and identified missing optimization opportunities in the Dart VM's optimizing compiler. The VM team also tuned the compiler (for example, inlining strategies and closure calls) for more efficient asynchronous Dart code.

* Again, by profiling some samples, we identified some elements in dart:core and dart:async, that was sub-optimal. (e.g Uri-parsing and toLowerCase).


Post has shared content
Dart 1.1 is out - with a greatly improved server side library!
New Dart 1.1 stable release is ready, featuring up to 25% faster JavaScript, new support for UDP for servers, more breakpoint locations while debugging in Dart Editor, and new docs for command-line and server apps.

Dart Editor can auto-update, or you can download the latest release from

Thanks to all our Dartisans who tested our dev channel releases. Enjoy the new features and performance!


Post has shared content
Dartlang's dart:io library is getting in shape :)
Dart VM can run on the server, and we show you how. Access files, directories, sockets, SSL, TCP, UDP, HTTP, web sockets, and more. Use Dart for command-line and server-side apps.


Post has shared content

Post has attachment
Wait while more posts are being loaded