Skip to content

Roadmap: Node.js + TypeScript compatibility & stability #793

@TheHypnoo

Description

@TheHypnoo

Why

Perry ships compatibility fixes reactively — users hit bugs, we patch. Recent open issues show the pattern: Effect mixins (#740), cross-module init at scale (#684), async_hooks / AsyncLocalStorage as name-only stubs (#788, #789), V8-fallback linker gaps (#678).

The root cause isn't any single bug — it's that we have no continuous, granular signal of where Perry stands on Node.js + TypeScript compatibility. CI reports a single 83% parity number; the gap-suite truncates output; test-parity/known_failures.json hides regressions; no Rust coverage tool runs.

This issue tracks the work to instrument compatibility, then close the holes the instrumentation reveals.

Scope — three axes of "compatibility"

  1. TypeScript language — closures, async, generators, classes, mixins, decorators, generics erasure, type-only imports, …
  2. JavaScript runtime semantics — Symbol, Proxy/Reflect, new.target, prototype chain, JSON ordering, regex, async context propagation, …
  3. Node.js platform — built-in modules with real semantics (not just API surface), and the npm ecosystem on top.

A single percentage across all three is meaningless. We need per-axis, per-category trends.

Existing infrastructure (axis 3 — already committed)

Per @proggeramlug's comment, axis 3 is ~70% built and committed, not yet CI-wired:

  • test-files/test_parity_<module>.ts × 42 — byte-for-byte behavioral probes per node:* module, diffed against node --experimental-strip-types (commits d0e84724, 08c9004a, 1f2f44e5).
  • docs/runtime-parity.md — Node + Bun stdlib inventory (~50 modules, ~4,200 API rows).
  • docs/runtime-parity-gaps.md — that inventory diffed against Perry's real compile-time coverage; 2,417 true gaps quantified.
  • scripts/gen_parity_tests.py + scripts/parity-skiplist.toml — regeneration + documented out-of-scope list.
  • run_parity_tests.sh --filter parity_ — runs just the matrix, permissive-compile so gaps surface as runtime divergence.

Current baseline (v0.5.910 sweep): 5 PASS (os, tty, async_local_storage, argon2, ethers); path one fix from PASS (#810); 18 compile-fails on import * as X from "node:X" where Perry has no stdlib backing. Trend across 5 sweeps v0.5.713→v0.5.910: 0→5 PASS.

#812 tracks wiring this into CI with a per-module trend artifact. Sub-issues below compose with #812 rather than replace it: #812 = per-module diff of Perry's stdlib; #794 = per-category regression thresholds (seeded from #812's baseline); #800 = run Node's own test corpus.

Sub-issues

Structural blockers (cross-cutting, high-leverage)

Bugs that block many APIs at once belong on this roadmap rather than in per-API tickets:

Non-goals

  • Implementing missing Node APIs (each gets its own issue) — except cross-cutting infra bugs that block many APIs at once, which are tracked above as structural blockers.
  • Pushing the raw parity %. The point is to see it accurately; improvements follow from the signal.

Done when

All sub-issues above are closed, or explicitly deferred with rationale here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions