# Perry
**Write TypeScript. Ship native. Everywhere.**
Perry compiles the TypeScript you already write into real machine-code executables โ for macOS, Windows, Linux, iOS, Android, watchOS, and TV. No Node.js to install. No Electron to bundle. No runtime at all. Just a binary. (The same codebase can also target the web, emitted as JavaScript or WebAssembly.)
[](https://github.com/PerryTS/perry/releases/latest)
[](https://discord.gg/chEmpGdTtZ)
[Website](https://perryts.com) ยท [Documentation](https://perryts.github.io/perry/) ยท [Showcase](https://perryts.com/showcase) ยท [Examples](https://github.com/PerryTS/perry-examples)
```bash
perry compile src/main.ts -o myapp
./myapp # a standalone native binary โ ~330 KB for hello world
```
## The language you know. The deployment you wish it had.
Millions of developers write TypeScript every day โ but shipping it has always meant shipping a JavaScript engine: a Node install on every server, ~100 MB of embedded runtime per CLI, or a whole browser engine per desktop app. Perry removes the engine. SWC parses your code, LLVM compiles it to machine code, and you get what systems languages get: instant cold starts, tiny self-contained binaries, real threads โ without leaving TypeScript.
| | **Perry** | Node.js | Bun | Electron |
|---|---|---|---|---|
| **What you ship** | One native binary, from ~330 KB | Your code + a Node install | One binary embedding the JS engine | App bundle with a browser engine |
| **Execution** | Ahead-of-time machine code | JIT | JIT | JIT |
| **Cold start** | Instant โ no engine to boot, no warmup | Engine boot + warmup | Engine boot + warmup | Browser boot |
| **Native UI (no WebView)** | โ
AppKit, UIKit, Android Views, Win32, GTK4 | โ | โ | Chromium |
| **iOS ยท Android ยท watchOS ยท TV** | โ
from the same codebase | โ | โ | โ |
| **Multicore** | Real OS threads, data-race-safe at compile time | worker_threads | workers | processes |
<sub>Table describes Perry's native targets. `--target web` / `--target wasm` emit JavaScript / WebAssembly that runs in the browser rather than as a native binary.</sub>
## Performance
Ahead-of-time machine code means no engine boot and no JIT warmup โ and on measured workloads, real multiples over the JS runtimes. Highlights from our open benchmark harnesses (Apple M1 Max, medians of repeated runs):
| Workload | **Perry** | Node.js | Bun | Rust |
|---|---:|---:|---:|---:|
| Image convolution (4K, 5ร5 Gaussian) | **354 ms** | 1,207 ms โ *3.4ร slower* | 915 ms โ *2.6ร slower* | 392 ms |
| Fibonacci (recursive calls) | **309 ms** | 987 ms โ *3.2ร slower* | 518 ms โ *1.7ร slower* | 316 ms |
| JSON pipeline (100 records) | **39 ms** | 144 ms โ *3.7ร slower* | 51 ms โ *1.3ร slower* | 34 ms |
| JSON pipeline (500k records, 108 MB) | **1,649 ms** | 1,010 ms โ *1.6ร faster* | 647 ms โ *2.5ร faster* | 604 ms |
| Object allocation (1M objects) | **2 ms** | 8 ms โ *4ร slower* | 6 ms โ *3ร slower* | <1 ms |
| Array write (10M elements) | **3 ms** | 9 ms โ *3ร slower* | 6 ms โ *2ร slower* | 7 ms |
| Peak memory (JSON pipeline) | **3.5 MB** | 36 MB โ *10ร more* | 11 MB โ *3ร more* | 1.2 MB |
Look at the Rust column again: on convolution, fibonacci, and the array-write loop, TypeScript compiled with Perry **runs even with โ or ahead of โ Rust**. And Electron isn't in the table because it doesn't compete here: it ships a whole browser engine per app, where a comparable Perry app is a single-digit-MB native binary.
<sub>Sources: convolution & JSON from the [systems-language report](https://github.com/PerryTS/perry/blob/7beb3a50ca/benchmarks/honest_bench/REPORT.md)
โ pinned to `7beb3a50ca`, the last revision whose artifact contains these values; the copy at HEAD was regenerated in #7641 on a host
where the harness clock was invalid and now reads 0.0 ms in every timing cell (see this PR). Re-pin to `main` once it is regenerated.
Fibonacci, object allocation & array write from the [polyglot sweep](benchmarks/polyglot/RESULTS.md) (Perry default mode, no fast-math).</sub>
We publish *everything*, including the workloads where V8's JIT still beats us โ no cherry-picked table can survive an open harness. Run it yourself: `./benchmarks/run_public_baseline.sh` ([methodology](benchmarks/README.md)).
<details>
<summary><b>The full published suite, generated from the artifact โ including the rows we lose</b></summary>
<!-- public-node-bun:start -->
Generated from [`benchmarks/results/public-node-bun-v1.json`](benchmarks/results/public-node-bun-v1.json) at Perry commit `b77aba63433b`.
Lower wall-clock median is better; every row includes complete raw samples and passed correctness checks. Medians within 5% of a peer count as a tie with it.
| Benchmark | Perry | Node.js | Bun | Result | What it tests |
|---|---:|---:|---:|---|---|
| modulo_loop | 93 ms | 95 ms | 95 ms | tie | Integer-modulo accumulation loop (microbenchmark) |
| method_calls | 35 ms | 11 ms | 8 ms | loss vs both | Class method dispatch |
| closure | 47 ms | 49 ms | 49 ms | tie | Closure creation and invocation |
| binary_trees | 13 ms | 6 ms | 6 ms | loss vs both | Tree allocation and traversal |
| string_concat | 6 ms | 31 ms | 5 ms | mixed | String append loop |
| prime_sieve | 6 ms | 5 ms | 5 ms | loss vs both | Sieve of Eratosthenes |
| mandelbrot | 25 ms | 24 ms | 29 ms | mixed | Complex-number iteration |
| matrix_multiply | 19 ms | 33 ms | 33 ms | win vs both | Matrix multiplication |
| json_roundtrip | 144 ms | 379 ms | 219 ms | win vs both | Parse and stringify ~1 MB JSON |
<!-- public-node-bun:end -->
</details>
## Why developers pick Perry
- **โก Native speed, zero warmup.** LLVM-optimized machine code with escape analysis, scalar replacement, and a generational GC โ see the [numbers above](#performance).
- **๐ฆ Binaries you can actually email.** Hello world is ~330 KB. Perry links only the runtime your program uses. A real MongoDB GUI built with Perry ships as [a ~7 MB app](https://github.com/MangoQuery/app).
- **๐ Your Node code mostly just works.** ~97% pass rate on Node's own test suite across 53 `node:*` modules โ real implementations of `fs`, `http`/`http2`, `net`/`tls`, `crypto`, `stream`, `child_process`, `worker_threads`, `fetch` and the web globals, plus ~50 popular npm packages (Fastify, Express, mysql2, pg, ioredis, ws, bcrypt, jsonwebtokenโฆ). Plain JavaScript compiles too.
- **๐ฅ๏ธ One UI codebase, 11 targets.** A SwiftUI-like API that compiles to *real* platform widgets โ macOS, iOS, iPadOS, visionOS, tvOS, watchOS, Android, Wear OS, Windows, Linux, Web/WASM. Even [home-screen widgets](https://perryts.github.io/perry/widgets/overview.html).
- **๐งต All your cores, safely.** `parallelMap`, `parallelFilter`, and `spawn` on real OS threads โ the compiler rejects shared mutable state, so data races don't compile.
- **๐ Batteries included.** Databases, WebSockets, containers, i18n, keychain, notifications, auto-update, a TUI framework โ natively implemented and statically linked.
## Get started in 60 seconds
```bash
# Install (macOS ยท Linux ยท Windows)
npm install -g @perryts/perry # or: brew install perryts/perry/perry
# or: winget install PerryTS.Perry
# Create and run a project
perry init my-app && cd my-app
perry run .
```
npm packages and ES modules work as you'd expect:
```typescript
import fastify from 'fastify';
const app = fastify();
app.get('/api/users', async () => [{ id: 1, name: 'Alice' }]);
app.listen({ port: 3000 }, () => console.log('Listening on :3000'));
```
```bash
perry compile src/main.ts -o api && ./api # one binary โ no node_modules on the server
```
Same code, other platforms: `--target ios`, `--target android`, `--target web`โฆ full list in the [platforms guide](https://perryts.github.io/perry/platforms/overview.html). APT, Scoop, install script, and source builds are in the [installation guide](https://perryts.github.io/perry/getting-started/installation.html); run `perry doctor` to verify your setup.
## Built with Perry
Real products, shipping today:
| Project | What it is | Platforms |
|---------|-----------|-----------|
| [**Bloom Engine**](https://bloomengine.dev) | Native TypeScript game engine โ Metal, DirectX 12, Vulkan, OpenGL | macOS, Windows, Linux, iOS, tvOS, Android |
| [**Mango**](https://github.com/MangoQuery/app) | Native MongoDB GUI โ ~7 MB binary, sub-second cold start | macOS, Windows, Linux, iOS, Android |
| [**Hone**](https://hone.codes) | AI-powered native code editor with terminal, Git, and LSP | macOS, Windows, Linux, iOS, Android, Web |
| [**dB Meter**](https://dbmeter.app) | Real-time sound level measurement at 60 fps | iOS, macOS, Android |
<p align="center">
<img src="docs/images/showcase/mango-explorer.png" width="400" alt="Mango โ native MongoDB GUI built with Perry" />
<img src="https://hone.codes/screenshot.png" width="400" alt="Hone โ AI code editor built with Perry" />
</p>
More in the [showcase](https://perryts.com/showcase) โ built something with Perry? Open a PR and add it.
## Documentation
Everything else lives in the [docs](https://perryts.github.io/perry/):
- [Getting started](https://perryts.github.io/perry/getting-started/installation.html) โ install, hello world, project config
- [Language support](https://perryts.github.io/perry/language/supported-features.html) โ supported TypeScript features and [limitations](https://perryts.github.io/perry/language/limitations.html)
- [Native UI](https://perryts.github.io/perry/ui/overview.html) ยท [Multi-threading](https://perryts.github.io/perry/threading/overview.html) ยท [Standard library](https://perryts.github.io/perry/stdlib/overview.html)
- [Platforms](https://perryts.github.io/perry/platforms/overview.html) โ per-platform guides from macOS to watchOS to WASM
- [CLI reference](https://perryts.github.io/perry/cli/commands.html) โ commands, flags, `perry.toml`, [privacy & telemetry](docs/src/cli/telemetry.md)
- [Contributing](docs/src/contributing/architecture.md) โ architecture, [building from source](docs/src/contributing/building.md), and the [release process](docs/src/contributing/releasing.md)
## Community
Perry is built in the open โ come say hi:
- ๐ฌ **[Join the Discord](https://discord.gg/chEmpGdTtZ)** โ get help, share what you're building, and talk directly to the people building Perry
- ๐ [Issues](https://github.com/PerryTS/perry/issues) โ bug reports and feature requests
- ๐ [Showcase](https://perryts.com/showcase) โ apps the community is shipping
## Privacy
Telemetry is **opt-in**: nothing leaves your machine unless you explicitly enable it in `~/.perry/config.toml`, and `PERRY_NO_TELEMETRY=1` (or `CI=true`) always wins. What can be sent is anonymous and redacted โ never your source, paths, or project names. Inspect it any time with `perry doctor`, and see exactly what's in the payload in the [privacy & telemetry docs](docs/src/cli/telemetry.md).
## Sponsors
Perry's development is backed by our sponsors. ๐
<p align="center">
<a href="https://www.skelpo.com">
<img src="docs/images/sponsors/skelpo-logo.svg" width="360" alt="Skelpo โ premium sponsor" />
</a>
</p>
<p align="center">
<strong>๐ <a href="https://www.skelpo.com">Skelpo</a> โ Premium Sponsor</strong>
</p>
Want to support Perry and see your logo here? Get in touch via [perryts.com](https://perryts.com).
## License
MIT