JSIR: A High-Level IR for JavaScript

Google open-sources JSIR and devs split: mind-blown, side-eyeing, and 'not new' vibes

TLDR: Google released JSIR, a new way to represent JavaScript that can convert back to code and power smarter analysis, already used for decompiling and deobfuscation. The community split between dreamy cross-language hype, suspicion about what’s still private, and a chorus saying this isn’t new—plus a push to ship the faster binary AST.

Google just dropped JSIR and the comments lit up. In plain English: it’s a new, high-level way to represent JavaScript that keeps every tiny detail, can boomerang back to JS without losing anything, and uses MLIR (a compiler toolkit) to run smarter analyses. It’s already used at Google to decompile Hermes bytecode and help deobfuscate code with an AI assist, and it’s on GitHub with a talk on YouTube.

The hype camp is dreaming big. One fan imagines cross-language magic—JSIR proves code can go to a universal format and back, so why not “transmorph” Rust into Swift? Meanwhile, the skeptics threw cold water fast: one commenter peered into the repo and noted “not everything is public,” while another dunked on Google’s “industry trend” pitch, insisting this was always best practice, not some new fad.

Then came a spicy side quest: a crowd called for the long-stalled TC39 binary AST (a compact, fast-to-parse code format) to ship already, arguing that would deliver instant wins for everyone. Newcomers asked what an “IR” even is, cue a helpful Wikipedia link. The memes? “IRL about an IR,” JSIR-as-“Just Ship It Right,” and plenty of boomerang jokes about round-tripping code back to source.

Key Points

  • JSIR is a high-level IR for JavaScript that preserves all AST information and enables lossless round-tripping between source, AST, and IR.
  • Built on MLIR, JSIR represents control flow with regions and supports CFG and dataflow analysis.
  • JSIR is open source (github.com/google/jsir) and is used in Google production for code analysis, decompilation, and deobfuscation.
  • The IR definition is public, stable, and closely aligned with ESTree to capture all source-level information for source-to-source transformations.
  • The RFC positions JSIR to fill a gap in JavaScript tooling, which is dominated by AST-based tools and lacks IR-based open tools.

Hottest takes

"Imagine transmorphing Rust to Swift and back." — sheepscreek
"it seems not everything is public" — jcuenod
"This was always the best practice. It’s not a "trend"." — pizlonator
Made with <3 by @siedrix and @shesho from CDMX. Powered by Forge&Hive.