Last week during TC39 meeting, 4 proposals we’ve been working on made it to Stage 1:

Readonly Collections for JS

Currently, JavaScript collections are unconditionally mutable. We believe many use cases could benefit from separating the ability to query a collection from the ability to mutate it. We’ve seen repeated calls for such support. To minimize the cognitive load of new API, we propose the addition of only three new methods to all collections and the addition of new collection classes whose APIs are only a subset of the existing collection abstractions. Read more

Eventual Send

This proposal adds eventual-send operations to JavaScript Promises, to express invocation of operations on potentially remote objects. We introduce the notion of a handled Promise, whose handler can provide alternate eventual-send behavior. These mechanisms, together with weak references, enable the creation of remote object communications systems with promise pipelining. This proposal is not specific to any one remote object system. Instead, it specifies a general mechanism for hooking in whatever host-provided remote communications facilities are at hand, without constraining the nature of those facilities. Read more

Wavy Dot (“~.”)

This proposal is to investigate notational support for promise pipelining. The concrete syntax we’re starting with is the “~.”, chosen by analogy with the optional chaining operator “?.”. Both can be thought of as “adjective dot”, i.e., like dot but different somehow. For ~. The difference is that the operation is performed eventually and possibly remotely. Read more

Out of memory immediately terminates agent cluster

The ECMAScript specification nowhere mentions the possibility of running out of memory (OOM), and so cannot be correctly implemented on finite memory machines. Allocation in JavaScript is pervasive and implicit, implying that an OOM may happen anywhere in the execution of the program. If OOM threw a catchable error, computation within the agent would continue in an inconsistent state. Instead, we should immediately terminate the agent cluster, in order to abandon all unrepairable inconsistent state. Read more