HeadlinesBriefing favicon HeadlinesBriefing.com

Google releases high‑level JavaScript IR for analysis

Hacker News •
×

An RFC posted to Hacker News details JSIR, a high‑level intermediate representation for JavaScript that retains every detail from the source AST. It supports lossless round‑tripping between source, AST and the IR, and models control‑flow with MLIR regions. Built on the MLIR framework, JSIR also exposes data‑flow analysis primitives for advanced tooling and integrates seamlessly with existing toolchains.

The move mirrors trends in Rust and Swift compilers, where language‑specific IRs enable analyses before lowering to LLVM. JavaScript tools like Babel, Closure and Webpack still rely on plain ASTs, limiting CFG and data‑flow capabilities. Google has deployed JSIR internally for decompiling Hermes bytecode and for large‑scale deobfuscation, a workflow described in a paper accepted to ICSE 2026 and scales to petabyte‑scale codebases.

Design goals emphasize a public, stable spec that mirrors ESTree nodes one‑to‑one, allowing perfect source ↔ AST ↔ IR conversion—internal tests report over 99.9 % success on billions of samples. By exposing a data‑flow API and traversal utilities, JSIR aims to make source‑to‑source transformations straightforward and to demonstrate that MLIR can serve as a universal compiler substrate. The project is now open on GitHub, ready for community adoption and developers can plug it into CI pipelines today.