perry README

The project's README from github.com/PerryTS/perry. As one markdown file: README.md.

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.)

Latest release Join the Perry Discord community

Website · Documentation · Showcase · Examples

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

Table describes Perry's native targets. --target web / --target wasm emit JavaScript / WebAssembly that runs in the browser rather than as a native binary.

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.

Sources: convolution & JSON from the systems-language report — 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 (Perry default mode, no fast-math).

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).

The full published suite, generated from the artifact — including the rows we lose

Generated from benchmarks/results/public-node-bun-v1.json at Perry commit 827a92bad5a5. Lower wall-clock median is better; every row includes complete raw samples and passed correctness checks.

Benchmark Perry Node.js Bun Result What it tests
factorial 59 ms 95 ms 61 ms win vs both Modular accumulation
method_calls 6 ms 9 ms 4 ms mixed Class method dispatch
closure 29 ms 30 ms 29 ms mixed Closure creation and invocation
binary_trees 6 ms 5 ms 9 ms mixed Tree allocation and traversal
string_concat 5 ms 37 ms 12 ms win vs both String append loop
prime_sieve 4 ms 4 ms 5 ms mixed Sieve of Eratosthenes
mandelbrot 15 ms 17 ms 16 ms win vs both Complex-number iteration
matrix_multiply 22 ms 24 ms 22 ms mixed Matrix multiplication
json_roundtrip 186 ms 407 ms 189 ms win vs both Parse and stringify ~1 MB JSON

Why developers pick Perry

Get started in 60 seconds

# 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:

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'));
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. APT, Scoop, install script, and source builds are in the installation guide; run perry doctor to verify your setup.

Built with Perry

Real products, shipping today:

Project What it is Platforms
Bloom Engine Native TypeScript game engine — Metal, DirectX 12, Vulkan, OpenGL macOS, Windows, Linux, iOS, tvOS, Android
Mango Native MongoDB GUI — ~7 MB binary, sub-second cold start macOS, Windows, Linux, iOS, Android
Hone AI-powered native code editor with terminal, Git, and LSP macOS, Windows, Linux, iOS, Android, Web
dB Meter Real-time sound level measurement at 60 fps iOS, macOS, Android

Mango — native MongoDB GUI built with Perry Hone — AI code editor built with Perry

More in the showcase — built something with Perry? Open a PR and add it.

Documentation

Everything else lives in the docs:

Community

Perry is built in the open — come say hi:

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.

Sponsors

Perry's development is backed by our sponsors. 🙏

Skelpo — premium sponsor

💎 Skelpo — Premium Sponsor

Want to support Perry and see your logo here? Get in touch via perryts.com.

License

MIT

perry (PerryTS/perry)

Searching Database…

Что это такое?Perry компилирует TypeScript или JavaScript, который вы уже пишете, сразу в исполняемые файлы с машинным кодом для macOS, Windows, Linux, iOS, Android, watchOS и TV. Для разбора кода используется SWC, для генерации машинного кода — LLVM, поэтому вместе с программой не нужно поставлять среду Node.js или сборку Electron.
Это библиотека, которую подключают в Node, или самостоятельный компилятор?Это самостоятельный компилятор с предварительной компиляцией (AOT) и набор инструментов командной строки, а не библиотека, которую подключают через require() в приложении Node. Он разбирает код с помощью SWC и выдаёт машинный код через LLVM, создавая самодостаточный исполняемый файл.
Как установить Perry и скомпилировать первую программу?Установите его через APT, Scoop, скрипт установки или соберите из исходников по инструкции в руководстве по установке, затем запустите компилятор для главного файла. Команда `perry doctor` проверяет, правильно ли настроено окружение, а `--target ios`, `--target android` и `--target web` меняют платформу, для которой создаётся результат.
Нужно ли устанавливать Node.js, чтобы запустить скомпилированный файл?Нет. Скомпилированные программы Perry вообще не требуют среды выполнения: ни Node, ни Bun, ни встроенного движка браузера, только сам исполняемый файл.
Будут ли мой существующий код на Node и npm-пакеты работать в Perry?Большинство распространённых API Node работает: примерно 97% тестов из собственного набора Node проходят по 53 модулям node:, а также около 50 популярных npm-пакетов, таких как Fastify, Express, mysql2 и ioredis. Но полной совместимости с Node нет, а поддерживаемый синтаксис TypeScript имеет задокументированные ограничения.
Для каких платформ я действительно могу выпустить приложение?Из одной кодовой базы можно собрать приложение для macOS, iOS, iPadOS, visionOS, tvOS, watchOS, Android, Wear OS, Windows, Linux и Web/WASM. API, похожий на SwiftUI, компилируется в настоящие нативные виджеты на каждой платформе.
Отправляет ли Perry какие-либо данные с моего компьютера или телеметрию?Телеметрия включается только по вашему желанию: ничего не отправляется, пока вы сами не включите её в ~/.perry/config.toml. Любые отправляемые данные анонимны и обезличены, исходный код и названия проектов никогда не передаются.
Насколько маленькими получаются итоговые бинарные файлы?Программа «hello world» компилируется примерно в 330 КБ, а реальное приложение, например GUI-клиент Mango для MongoDB, занимает около 7 МБ и холодно запускается меньше чем за секунду.
Как Perry делает многоядерный код безопасным?Он предоставляет parallelMap, parallelFilter и spawn, которые работают на настоящих потоках ОС. Компилятор отклоняет общее изменяемое состояние, поэтому гонки данных приводят к ошибке компиляции, а не к сбою во время выполнения.
Насколько Perry быстрее Node.js или Bun?В опубликованном наборе бенчмарков Perry обгоняет оба на таких задачах, как конкатенация строк и многократные преобразования JSON туда и обратно (в некоторых случаях более чем в 3 раза быстрее Node). JIT-компилятор V8 всё же выигрывает в нескольких случаях с большими данными, а авторы публикуют полные результаты, включая проигрыши.
Какие приложения уже создали с помощью Perry?В числе показанных проектов: Bloom Engine, нативный игровой движок на Metal, DirectX12 и Vulkan; Mango, нативный GUI для MongoDB; Hone, редактор кода на основе ИИ; и dB Meter, приложение для измерения уровня звука в реальном времени. Все они выпускаются на нескольких нативных платформах из одной кодовой базы.
What are similar projects?CalcKernel, scriptc, Tov, goose, lightcraft, Kof4j, swift, yew
Creator
PerryTS
Size
482 MB
Stars
5K
Age
8mo
Commits · 90 Days