Skip to content

perry

v0.5.343 Breaking

This release includes 1 breaking change for platform teams planning a safe upgrade.

Published 1mo Build & Package
✓ No known CVEs patched
Read the diff → Tool health → What is this tool? →

✓ No known CVEs patched in this version

Topics

android compile harmonyos ios llvm macos
+5 more
native smc typescript watchos windows

Summary

AI summary

Centralized exhaustive HIR walker closes a major bug class, massively refactors compiler internals across performance, code size, and infrastructure.

Full changelog

Highlights

Largest cognitive-load reduction in the project's history (15 commits in the v0.5.329→v0.5.343 series): compile.rs shrunk −60%, lower.rs −44%, lower_call.rs −45%, and lower::lower_expr −91%. ~14k LOC reorganized into 19 focused sub-modules. Every baseline green throughout: workspace 434/0/5, gap 25/28, doc-tests 80/82.

Closes the recurring _ => {} HIR walker bug class (root cause of #167, #169, #212, #214) via a single exhaustive walker that turns enum-variant additions into compile errors instead of silent miscompiles.

Compiler internals (refactor)

  • Centralize Expr descent in walker.rs — exhaustive match, no _ catch-all (closes #167/#169/#212/#214 bug class)
  • Centralize UI / system / i18n dispatch tables in new perry-dispatch crate — eliminates 4-site fan-out across LLVM/JS/WASM backends
  • Symbol-set strip-dedup via llvm-nm — replaces fragile name-pattern matching that broke Linux generic monomorphizations (#181)
  • Split compile.rs (9391→3783 LOC), lower.rs (13591→7554), lower_call.rs (7000+→3866) into focused sub-modules
  • Pilot + mass-extract lower_expr arms (Cond/Update/Tpl/Seq/Yield/Await/SuperProp/MetaProp/Arrow/Fn/Object/Member/Assign/New/Call) into lower/expr_*.rs modules

Performance

  • Fuse 4 sequential module scans in inliner + 5 sequential rayon passes in compile pipeline
  • Bound parse cache at 500 entries with FIFO eviction (was unbounded — perry dev could leak 100+ MB of SWC AST)
  • Parallelize per-module .ll writes
  • Wrap i18n table in Arc<> to avoid per-rayon-worker clones
  • Combine three mutable-captures passes in HIR analysis

Fixes

  • #214 SSO string-array crashes: unbox_to_i64 returns garbage for short-string-optimization values; converted 7 string-operand callsites (arr.join, obj[ssoKey], delete, string.match, process.env) to SSO-safe unbox_str_handle
  • #212 class-method captures: classes declared inside a function whose method body references enclosing-fn locals now compile + run via hidden __perry_cap_<id> instance fields with full ctor + inheritance + setter-write-through support
  • #181 Linux GTK4 link: silent pkg-config fallback hole + strip-dedup over-pruning generic monomorphizations
  • #220 Windows: add secur32.lib to link line
  • #219 doc-tests: empty // platforms: directive opts out of host run phase
  • #167 stack eat: hoist js_native_call_method args alloca to entry block (was leaking 16 bytes/iter inside loop bodies)
  • #169 Uint8Array params: missing inliner arms caused _ => {} fallthrough → SIGTRAP
  • #216/#217/#218 GTK4: 7 missing FFIs (open_folder_dialog, widget tree ops, SplitView)
  • #154 using/await using: ES2024 explicit resource management dispose hooks
  • #106 watchOS: weak fallbacks for game-loop FFI hooks (unblocks runtime-only --features watchos-game-loop)
  • #198 i18n FormatNumber: FP round-trip via Ryū algorithm (closes #207)
  • #196 jsruntime: drop redundant test causing Linux V8 re-init segfault
  • #197 benchmarks: portable /usr/bin/time flag detection on Linux
  • #185 macOS shadow: set masksToBounds: NO so corner-radius widgets don't clip CALayer shadow
  • ui-slider FFI sig parity across all 7 backends
  • Cross-compile from aarch64 macOS host (Linux/Windows codegen, iOS lib path)

Features

  • #185 inline style: {...} API (Phase A + B + C): styling matrix infrastructure + cross-platform widgetSetShadow + opacity / borders / text decoration + Phase C inline style: { backgroundColor, border*, padding, shadow, gradient, ... } on every Widget-returning constructor (Button, Text, Toggle, Slider, ProgressView, VStack, HStack, …) — works on every platform that has the underlying setters wired
  • #98 background notifications: notificationOnBackgroundReceive on iOS (UIBackgroundFetchResult-gated) + Android (FCM) warm-path
  • #190 Canvas widget in LLVM codegen
  • #191 CameraView widget wired through every codegen path
  • #192 Table widget wired through every codegen path
  • #189 perry/plugin codegen dispatch (#203)
  • #193 11 stdlib helpers wired (#205, partial)
  • #202 GTK4 4 styling FFIs (#206)
  • #194 doc-tests --app-bundle-id for widget cross-compile (#200)
  • #195 HIR error on widget method-chain modifier syntax (#201)
  • #188 perry/i18n format wrappers (Currency / Percent / FormatNumber / ShortDate / LongDate / FormatTime / Raw)
  • #209 file: deps inside cwd no longer strip FFI imports on --target web

Infrastructure

  • Drift-checked styling matrix integration test (crates/perry-ui/tests/styling_matrix_drift.rs) across 8 native platforms + Web
  • Dispatch-table consistency test in perry-dispatch (caught a pre-existing duplicate scrollViewSetOffset row)
  • New regression tests for the SSO unbox + class-method capture + loop-alloca bug classes
  • Linux build fix: clang discovery + duplicate sqlite symbol resolution
  • Sponsor button routes to Ko-fi

Breaking Changes

  • Centralized exhaustive match in `walker.rs` removes the `_ => {}` catch‑all, turning enum variant additions into compile errors (closes #167/#169/#212/#214).

Weekly OSS security release digest.

The CVE patches and breaking changes that affected production tools this week. One email, every Sunday.

No spam, unsubscribe anytime.

Share this release

Track perry

Get notified when new releases ship.

Sign up free

About perry

A native TypeScript compiler written in Rust. Compiles TypeScript directly to executables using SWC and LLVM.

All releases →

Beta — feedback welcome: [email protected]