Updates in the JS ecosystem around the recently-released Node 22 and V8

V8, the JS runtime underneath Chrome, Edge, Node, Deno, and Electron, got some useful improvements for developers.

One is a new simple (single-pass SSA, CFG, IR builder) JIT for short-lived programs like command-line tools or serverless functions. Called Maglev.

I’m very interested how it will stack up against AWS’s low-latency runtime (LLRT) that will be compatible with “some of” Node, also optimized for start-up time instead of long-running applications which benefit more from a more complex and rigorous optimizing JIT.

Another bonus from v8 12.4 is new JS language features:

Array.fromAsync() takes an iterable of promises and returns an array of awaited items in serial fashion. It can be used with async generator functions too.

New Set methods like intersection, union, etc. I assumed these would have to get added at some point because it’s so obvious to have them and they’re a great DX in langs like Python and Kotlin.

Iterable helper methods. These let you do some more functional-style things with iterators like .filter(), .map() and all sorts of things you can do on arrays. But an iterable can be an infinite generator so these methods get applied as you grab more values from the iterator (with .next()) instead of all at once as on an array.

Also: now you can require() an ES module, and WebAssembly support for garbage collected languages.

Leave a Reply