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
- #142 —
Math.tan/asin/acos/atan/atan2were 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.
- #146 —
perry/threadprimitives (parallelMap/parallelFilter/spawn) compiled clean and silently returnedundefined. Wired up + added a compile-time mutable-outer-capture check with a broadened bypass-closure for named-function callbacks. - #150 —
Object.getOwnPropertyDescriptorreturnedundefinedon Phase 3 anon-shape literals. Scalar-replacement escape check now conservatively escapes all candidates on un-enumerated HIR variants. - #158 —
Map/Settreated-0and+0as distinct keys. Added SameValueZero normalization. - #20 —
console.trace()now emits a real native backtrace to stderr (needsPERRY_DEBUG_SYMBOLS=1for 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_typesregistry consulted at callsites. - Added an
extract_options_fieldshelper for builtin constructors (Response / Request / Headers / Error) that handles bothExpr::Objectand Phase 3'sExpr::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.rscovering Phase 1/3/4/4.1 inference. - Four new follow-up issues filed (#154
await using, #155console.time, #156queueMicrotask/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.