Type inference for plain JavaScript to enable static tier compilation, and broader JS semantics compatibility.
Raw Developer Origin & Technical Request
GitHub Issue
Jul 27, 2026
Hi, author of [JS2](github.com/loopdive/js2 here. Same architecture as scriptc as far as I can tell: tsc for parsing and type checking, a typed IR in the middle, swappable backends (we lower to WasmGC and linear-memory wasm). Fun to see how many of the same decisions you ended up making.
A couple of things we do differently. We also take plain JavaScript as input, with type inference to recover static types where there are no annotations. And we aim at full JS semantics rather than rejecting what can't be typed — in standalone mode (pure wasm, no JS host, so roughly comparable to your static tier) we pass about 22.6k of test262, tracked publicly.
The IR itself is work in progress — we're migrating from direct AST-to-wasm codegen onto a typed SSA IR node kind by node kind, with backend-agnosticism as the design goal.
The direction might be relevant to scriptc: untyped code currently goes to your quickjs tier, and with inference some of it could land in the static tier instead. It wouldn't touch the "nothing is silently miscompiled" rule — inferred types could go through the same runtime validation you already do for `any` at the boundary.
Would you be open to a small experiment at some point, say compiling one inferred-JS function through your IR? The main thing that needs is the IR/serializer being documented enough to target. Either way, happy to compare notes.
Developer Debate & Comments
No active discussions extracted for this entry yet.
Adjacent Repository Pain Points
Other highly discussed features and pain points extracted from vercel-labs/scriptc.
Frequently Asked Questions
Market intelligence mapped to Type inference for plain JavaScript to enable static tier compilation, and broader JS semantics compatibility..
What problem does Type inference for plain JavaScript to enable static tier compilation, and broader JS semantics compatibility. solve?
What architecture is tied to Type inference for plain JavaScript to enable static tier compilation, and broader JS semantics compatibility.?
Engagement Signals
Cross-Market Term Frequency
Quantifies the cross-market adoption of foundational terms like type inference and test262 by tracking occurrence frequency across active SaaS architectures and enterprise developer debates.
SaaS Metrics