How perryts/perry works
Perry is a TypeScript compiler and native application platform, with JavaScript and WebAssembly as additional targets. The main workflow is source code through the compile driver and code generation to a standalone executable; platform-specific UI backends and the native runtime provide important parallel capabilities. The README documents broader runtime and platform support than the sampled source establishes, so those subsystems are shown at their documented directory level, with uncertain internal wiring omitted.
Main entry points: run_pipeline.rs Compile driver · perry-runtime Native runtime · lib.rs Native codegen · src Perry CLI
Components 19
Compile frontend
- Perry CLI
crates/perry/src - Compile driver
crates/perry/src/commands/compile/run_pipeline.rs - Parser and HIR
crates/perry-parser
Code generation
- Native codegen
crates/perry-codegen/src/lib.rs - WebAssembly backend
crates/perry-codegen-wasm/src/lib.rs - JavaScript backend
crates/perry-codegen-js/src/lib.rs - Native UI backends
crates/perry-codegen-arkts/src/lib.rs - SwiftUI backend
crates/perry-codegen-swiftui/src/lib.rs - Wear tiles backend
crates/perry-codegen-wear-tiles/src/lib.rs - Glance backend
crates/perry-codegen-glance/src/lib.rs
Runtime platform
- Native runtime
crates/perry-runtime - Standard library
crates/perry-stdlib - Native ABI
crates/perry-abi/src/lib.rs
Other components
- TypeScript developer
- TypeScript source
- Native executable
- Web output
- Platform UI targets
- OS threads
Connections 23
- TypeScript developer → TypeScript source: writes
- TypeScript source → Perry CLI: compiles
- Perry CLI → Compile driver: invokes
- Compile driver → Parser and HIR: parses and lowers
- Compile driver → Native codegen: generates native code
- Compile driver → JavaScript backend: selects web target
- Compile driver → WebAssembly backend: selects wasm target
- Compile driver → Native UI backends: selects target
- Compile driver → SwiftUI backend: selects target
- Compile driver → Wear tiles backend: selects target
- Compile driver → Glance backend: selects target
- Native codegen → Native runtime: emits runtime calls
- Compile driver → Native executable: links and packages
- Native codegen → Native executable: emits machine code
- JavaScript backend → Web output: emits JavaScript
- WebAssembly backend → Web output: emits WebAssembly
- Native UI backends → Platform UI targets: builds native widgets
- SwiftUI backend → Platform UI targets: builds native UI
- Wear tiles backend → Platform UI targets: builds tiles
- Glance backend → Platform UI targets: builds UI
- Native runtime → Standard library: supports native APIs
- Native runtime → Native ABI: exposes native interface
- Native runtime → OS threads: provides thread support