2023-06

2023-06-27 The 125th General Assembly held in Geneva on 27 June 2023 approved the following documents

The 125th General Assembly held in Geneva on 27 June 2023 approved the following documents that are relevant to the JavaScript community:

  • ECMA-262 14th edition – ECMAScript 2023 Language Specification

  • ECMA-402 10th edition – ECMAScript 2023 Internationalization API specification

  • ECMA-419 2nd edition – ECMAScript embedded systems API specification

  • ECMA-423 1st edition – Holographic Data Storage Disk (HDSD) – Capacity: 1 Tbyte per disk

2023-06-27 What’s Next for JavaScript: New Features to Look Forward to

Useful types and modern tools to make internationalizing your sites and web apps easier, plus hints at what might come later for JavaScript.

Some significant new features, like Temporal, are almost ready for adoption; and others are in development to arrive in the next few years.

We’ve picked some of the most interesting here, as well as asking people involved in building the JavaScript standards to explain how the language is progressing, and what it might make sense for JavaScript standardisation to tackle next.

Types That Don’t Turn JavaScript into TypeScript

TypeScript was developed to make JavaScript developers more productive, rather than to replace JavaScript, but it’s also been a source of improvements to the language.

Currently, you use TypeScript to make types explicit in your code while you’re writing it — but then you remove them when your code runs.

Still some way off, the stage 1 Type Annotations proposal for including type information in JavaScript code but having them treated as comments by JavaScript engines is important, because it converges TypeScript and JavaScript for consistency in a way that keeps them aligned, but also makes it clear that they’re working at different layers

“If you’re working with a lot of different code that you didn’t write, then it helps to have the type view of it,” suggested Daniel Ehrenberg, vice president of Ecma (parent organization of TC39) and a software engineer working on JavaScript developer experience at Bloomberg.

Simplifying Localization with Smarter Message Formats

Localizing websites (and web apps) is more complicated than just swapping out the message strings in the user interface, because if you want those messages to make sense and be grammatically correct, you can’t just swap in words without thinking about how numbers, ordinals (like first and second), dates, plurals and other constructions are handled in different languages.

There are libraries to help with this, like FormatJS, but it’s more work for developers and translators in JavaScript than in other languages like Java and C, where there are built-in capabilities for translating and formatting strings with international Unicode components like ICU4J and ICU4.

“Plurals are really difficult,” Igalia’s Romulo Cintra tells us. “All the grammatical concepts, inflections and depending on gender number, and then different placeholders can vary in different languages; [handling] this complexity normally relies on those libraries, but also requires tons and tons of data.”

A Language for Translating Languages

The MF 2.0 spec defines what you can think of as a simple programming language with name binding (“let” declarations) and pattern matching (selectors), explained Igalia’s Tim Chevalier, who is working on the ICU implementation.

He suggested thinking of it as “a domain-specific language for writing translatable messages” that can draw on what we know about writing compilers and interpreters.

“Hopefully, the developer experience using MF 2.0 will be less like writing cryptic strings of characters and more like programming in a special-purpose language embedded within their general-purpose language of choice, such as JavaScript.”

He compares that to going from hard-coded query strings for working with databases to SQL.

2023-06-09 SpiderMonkey Newsletter (Firefox 114-115)

SpiderMonkey is the JavaScript engine used in Mozilla Firefox.

This newsletter gives an overview of the JavaScript and WebAssembly work we’ve done as part of the Firefox 114 and 115 Nightly release cycles.