Internet

ECMAScript 2024 takes shape


ECMAScript 2024, a planned update to ECMA’s standard for JavaScript, is set to include seven new features ranging from array grouping to Unicode strings. The 2024 specification, from ECMA’s Technical Committee 39, is expected to be approved in June.

Among the list of finished features cited for publication this year is a proposal for array grouping. Motivating this proposal is the notion that array grouping is a common operation best exemplified by SQL’s GROUP BY clause and mapreduce programming. The ability to combine like data into groups lets developers compute higher order data sets.

Other new features for the 2024 specificaton include ArrayBuffer transfer, which adds new methods to ArrayBuffer.prototype, and resizable and growable ArrayBuffers, which extend ArrayBuffer constructors to take an additional maximum length, allowing for in-place growing and shrinking of buffers. Growable ArrayBuffers promise to provide better memory management and serve as a sync-up capability with WebAssembly memory growth. Another ECMAScript 2024 feature, asynchronous atomic await, would be primarily for use in agents that are not allowed to block.

Another new feature, promise with resolvers, makes it easier to configure a promise’s resolution and rejection behavior after instantiating it. This has required a cumbersome workaround to extract resolve and reject functions from a callback scope, the proposal states.

With well-formed Unicode strings, ECMAScript developers are moving forward on a method to verify if a given ECMAScript string is well-formed or not. Goals of the proposed method include improving performance and increasing the clarity for readers of code where this test is being performed, especially for readers without extensive Unicode or regular expression knowledge.

ECMAScript 2024 also will extend the syntax for character classes to add support for set difference/subtraction, set intersection, and nested character classes.

Last year’s ECMAScript 2023 featured methods for searching and changing arrays and extended the WeakMap API.

Copyright © 2024 IDG Communications, Inc.



READ SOURCE

Business Asia
the authorBusiness Asia

Leave a Reply