TC39 Day 1: ES2017 Last Call

On the first day of TC39 (hosted by Facebook), we covered: the final features we hope make it into ES2017, improvements to regular expressions and promises, a grab-bag of tweaks to modules, and assorted other topics.

ES2017 Last Call

We started the day by looking at features that hadn't yet made it to Stage 4, but which the champion thinks will make it by the deadline (which is more or less now).

There were two such features:

First, global will reference the global variable in standard ECMAScript. This paves the cowpath laid down by Node.

Second, Shared Array Buffer, "Shared memory and atomics for ECMAscript." Dave wrote about this back in February 2015 about how developers can use Shared Array Buffer as an Extensible Web primitive for experimenting with parallelism approaches in userland:

And crucially, developers would be able to start building higher-level abstractions. As one example, I’ve sketched out API ideas for region-slicing, data-race-free sharing of portions of a single binary buffer, and this could easily be polyfilled with SharedArrayBuffer.

Similarly, multi-dimensional parallel array traversals, similar to PJS, could be polyfilled in plain JavaScript, instead of being blocked on standardization. Each of these APIs has pros and cons, including different use cases and performance trade-offs.

And the Extensible Web approach lets us experiment with and settle on these and other high-level abstractions faster than trying to standardize them directly.

These features may still stall before making it into ES2017, but all signs are positive at the moment.

Better . in Regular Expressions

This proposal by Mathias Bynens creates a new /s flag for regular expressions, which allows . to match newlines.

TLDR: The . character in normal regular expressions doesn't match newlines:

// → false

You can use this workaround to mean "any character", but it's pretty darn cryptic:

// → true

The solution is to add a new /s flag that fixes the meaning of .:

// → true

This feature advanced to Stage 1 and will likely advance to Stage 2 next meeting.

Tomorrow, I'll cover some of the discussions around promises and modules, along with anything else we do on Day 2.

I'll also try to cover more about how the TC39 process works over the next few days. If you have any specific questions you want me to answer please tweet at me or Dave.