Get started

Install Perry and start compiling JavaScript/TypeScript to native executables

01 · Installation

npm / npx
$ npm install -g @perryts/perry
Recommended cross-platform install. Native targets still require the relevant platform SDK and linker; run perry doctor after installation.
Homebrew (macOS)
$ brew tap PerryTS/perry
$ brew install perry
Supports macOS arm64 and x86_64. Xcode Command Line Tools are required for native linking.
APT (Debian/Ubuntu)
$ curl -fsSL https://perryts.github.io/perry-apt/perry.gpg.pub | sudo gpg --dearmor -o /usr/share/keyrings/perry.gpg
$ echo 'deb [signed-by=/usr/share/keyrings/perry.gpg] https://perryts.github.io/perry-apt stable main' | sudo tee /etc/apt/sources.list.d/perry.list
$ sudo apt update && sudo apt install perry
Supports x86_64 and arm64 Linux. Install GCC or Clang; some targets require Clang 15 or newer.
Windows (winget)
$ winget install PerryTS.Perry
Supports Windows x86_64 and arm64. Native and cross-target builds may require LLVM plus MSVC or xwin tooling.
From Source
$ git clone https://github.com/PerryTS/perry.git
$ cd perry
$ cargo build --release
Requires Rust, LLVM/Clang, and the SDK/toolchain for the target platform. The binary is written to target/release/perry.

02 · Usage

Verify the toolchain
$ perry doctor
Checks the compiler, linker, SDK, and target setup
Compile a file
$ perry compile main.ts
Compiles main.ts to a native executable
Compile JavaScript
$ perry compile main.js
Plain JavaScript uses the same native compilation pipeline
Custom output
$ perry compile main.ts -o myapp
Specify the output executable name
With V8 runtime
$ perry compile main.ts --enable-js-runtime
Enable V8 for JavaScript npm package compatibility
Check compatibility
$ perry check ./src
Validate JavaScript/TypeScript code for native compilation

Your first binary, step by step

Once Perry is installed, compiling JavaScript/TypeScript to a native executable is a single command. Write a file:

// hello.ts
const name = process.argv[2] ?? "World";
console.log(`Hello, ${name}!`);

This example also works as hello.js. Compile it and run the result. The output is a self-contained machine-code binary, not a bundled script:

$ perry compile hello.ts
✓ Compiled executable: hello
$ ./hello Perry
Hello, Perry!

The published runtime-only hello-world measurement is about 3.2 ms on the documented Apple M-series test host. Real startup depends on the target, linked features, I/O, and hardware. Read more abouthow Perry compiles JavaScript/TypeScript to a binary or what happens inside the JavaScript/TypeScript native compiler.

Where to go next