github PerryTS/perry v0.5.177

latest releases: v0.5.1151, v0.5.1150, v0.5.1129...
one month ago

Highlights

The long-hanging object-layout + type-inference arc lands (Phases 1/3/4/4.1 against the Static Hermes side-by-side), along with the first gap-tests bump in months (17 → 23 of 28), a benchmark refresh that finally beats Node on json_roundtrip (was Perry's one outstanding loss), and fixes for seven filed issues.

Fixes

  • #142Math.tan / asin / acos / atan / atan2 were silent identity functions. Codegen now calls the existing runtime symbols. (ce550d9, via PR #148.)
  • #144 — TypeScript decorators were parsed into HIR but silently dropped at codegen. Compiler now hard-errors with a message naming the decoration point.
  • #146perry/thread primitives (parallelMap / parallelFilter / spawn) compiled clean and silently returned undefined. Wired up + added a compile-time mutable-outer-capture check with a broadened bypass-closure for named-function callbacks.
  • #150Object.getOwnPropertyDescriptor returned undefined on Phase 3 anon-shape literals. Scalar-replacement escape check now conservatively escapes all candidates on un-enumerated HIR variants.
  • #158Map / Set treated -0 and +0 as distinct keys. Added SameValueZero normalization.
  • #20console.trace() now emits a real native backtrace to stderr (needs PERRY_DEBUG_SYMBOLS=1 for symbolicated frames).
  • Phase 3 follow-up — Error.cause AST extraction now handles new Error(msg, { cause }) shorthand and ({ cause: e }) paren-wrap (were silently losing .cause).

Features

  • Phase 1 — structural shape inference for closed object literals in infer_type_from_expr.
  • Phase 3 — anonymous class synthesis (__AnonShape_N) for closed literals so property access hits the direct-GEP fast path. Backed by a synthesized constructor so per-literal values survive shape dedup.
  • Phase 4 / 4.1 — body-based return-type inference for free functions, class methods, getters, and arrow expressions; method-call return-type inference via a class_method_return_types registry consulted at callsites.
  • Added an extract_options_fields helper for builtin constructors (Response / Request / Headers / Error) that handles both Expr::Object and Phase 3's Expr::New { __AnonShape_N } shapes.

Benchmarks

Reshot on current main. Perry wins every workload in the main suite vs Node.js and Bun (16 of 16 including json_roundtrip — 314 ms vs Node 377 ms, was 1.58× slower at v0.5.166). Polyglot: leads on 5 of 8 cells vs Rust / C++ / Go / Swift / Java; ties fibonacci with C++; trails by 1-2 ms on three stack-struct-friendly rows. README.md tables + benchmarks/baseline.json updated.

Infrastructure

  • CLAUDE.md "Recent Changes" tightened to 1-2 line summaries.
  • 40-test HIR integration suite added at crates/perry-hir/tests/shape_inference.rs covering Phase 1/3/4/4.1 inference.
  • Four new follow-up issues filed (#154 await using, #155 console.time, #156 queueMicrotask/performance.now, #157 typed-array constructors, plus the existing #29 for lone-surrogate string handling) covering the remaining 5 failing gap tests.

Gap tests

22 / 28 → 23 / 28 passing vs node --experimental-strip-types. Remaining known-failing: async_advanced, console_methods, global_apis, string_methods, typed_arrays. All tracked in GitHub issues.

Don't miss a new perry release

NewReleases is sending notifications on new releases.