v0.4.24 — target tvOS, kompilasi silang iOS/macOS dari Linux, perry login

Satu Kode Sumber. Semua Platform.
Performa Native.

Perry mengompilasi TypeScript menjadi aplikasi GUI dan CLI native di macOS, iPadOS, iOS, Android, Linux, Windows, watchOS, tvOS, WebAssembly, dan Web. Tanpa runtime. Tanpa Electron. Hanya binary native.

terminal

$ perry compile main.ts

Mengompilasi main.ts...

✓ Executable terkompilasi: main (2,3 MB)

$ ./main

Hello, World!

10
Target
25+
Widget UI native
0 ms
Waktu mulai
App Store
Siap

Mengapa Perry?

Semua yang Anda butuhkan untuk mengompilasi TypeScript menjadi aplikasi native

Tanpa Runtime

Menghasilkan executable native yang berdiri sendiri. Tanpa Node.js, tanpa V8, tanpa dependensi runtime. Hanya satu binary yang berjalan di mana saja.

Kompilasi Cepat

Kompilasi langsung dari TypeScript ke kode native menggunakan SWC untuk parsing dan Cranelift untuk pembuatan kode. Tanpa JavaScript perantara.

Binary Kecil

Binary output biasanya berukuran 2-5 MB. Dengan runtime V8 opsional untuk paket npm JS, 15-20 MB. Kirim lebih sedikit, deploy lebih cepat.

Type-Safe

Memanfaatkan sistem tipe TypeScript untuk optimasi. Tipe memungkinkan pembuatan kode yang lebih baik melalui monomorphization.

Standard Library Lengkap

Implementasi native bawaan untuk fs, path, crypto, os, Buffer, child_process, dan lainnya. Gunakan API Node.js yang familiar.

Runtime V8 Opsional

Perlu menggunakan paket npm JavaScript murni? Aktifkan flag runtime V8 untuk kompatibilitas penuh dengan ekosistem npm.

25+ Widget UI Native

Tombol, field teks, area teks, tabel, canvas, scroll view, kode QR, field aman, layar pembuka, dan lainnya — semuanya dikompilasi menjadi widget platform asli melalui AppKit, GTK4, Win32, UIKit, dan JNI.

Sistem Plugin Waktu Kompilasi

Modul dikomposisi saat build — tanpa overhead plugin saat runtime, tanpa batasan IPC. Dependensi Anda menjadi pemanggilan fungsi native langsung di binary akhir.

Multi-Threading Sejati

Thread OS nyata dengan parallelMap, parallelFilter, dan spawn. Keamanan waktu kompilasi menolak capture yang bisa berubah — tanpa SharedArrayBuffer, tanpa worker, hanya thread.

i18n Waktu Kompilasi

Ekstraksi string otomatis, aturan jamak CLDR untuk 30+ bahasa, validasi waktu kompilasi. Terjemahan ditanam ke binary dengan pencarian runtime hampir nol.

Native di Semua Platform

Perry mengompilasi TypeScript Anda ke framework UI native, WebAssembly, dan JavaScript — bukan web view, bukan Electron. Widget native asli di setiap platform, plus web.

macOS

AppKit

Stabil

iOS

UIKit

Stabil

iPadOS

UIKit

Stabil

Android

Views

Stabil

Linux

GTK4

Stabil

Windows

Win32

Stabil

watchOS

SwiftUI

Stabil

tvOS

SwiftUI

Stabil

WASM

WebAssembly

Stabil

Web

JavaScript

Stabil
Perbandingan Framework

Satu-satunya framework yang memenuhi semua kriteria

TypeScript dikompilasi ke kode native. Widget platform asli. Nol overhead runtime.

FrameworkBahasaKode NativeWidget NativeOverhead Runtime
PerryAOT compiled to native binary
TypeScript
None
React NativeJIT / interpreted at runtime
JS / TypeScript
Hermes / V8 + Bridge
FlutterAOT compiled, custom renderer
Dart
Dart VM + Skia engine
KMP + ComposeJVM on Android, native on iOS
Kotlin
Sebagian
Kotlin runtime + Skia
Swift for AndroidNative binary, no shared UI
Swift
Tanpa UI bersama
Swift runtime on Android
.NET MAUIPartial AOT via Mono
C#
Sebagian
.NET / Mono runtime
NativeScriptJS runtime, native widget access
JS / TypeScript
V8 / JavaScriptCore
IonicWeb app in native wrapper
JS / TypeScript
WebView + Capacitor
Dikompilasi native
Widget platform asli
Nol overhead runtime

Tulis TypeScript, Kirim Native

Gunakan sintaks dan API TypeScript yang familiar. Perry menangani sisanya.

hello.ts
// hello.ts
const greeting = "Hello, World!";
console.log(greeting);
 
// Compiles to ~2MB native executable
// No runtime needed!
$ perry build hello.ts
Binary native

Perbandingan Performa

Kompilasi native memberikan efisiensi tak tertandingi

MetrikPerryNode.jsBun
Ukuran Binary2-5 MB~80 MB~90 MB
Waktu Mulai~1 ms~30 ms~10 ms
Dependensi RuntimeTidak adaNode.jsBun
Overhead MemoriMinimalV8 + GCJSC + GC

Hasil Benchmark: 2,2x Lebih Cepat

Perry vs Node.js v24 di macOS ARM64 (lebih rendah lebih baik)

closure
4.5x
object create
3.5x
array read
3.0x
math intensive
3.0x
method calls
3.0x
binary trees
2.7x
string concat
2.5x
fibonacci
2.1x
mandelbrot
1.9x
factorial
1.7x
Ukuran BinaryLebih rendah lebih baik
Perry
5 MB
Node.js
80 MB
Bun
90 MB

Mulai

Instal Perry dan mulai mengompilasi TypeScript menjadi executable native

1Instalasi

terminal
$ brew tap PerryTS/perry
$ brew install perry

Memerlukan Homebrew. Mendukung macOS arm64 dan x86_64.

2Penggunaan

Kompilasi file
perry build main.ts

Mengompilasi main.ts menjadi executable native

Output kustom
perry build main.ts -o myapp

Tentukan nama executable output

Dengan runtime V8
perry build main.ts --enable-js-runtime

Aktifkan V8 untuk kompatibilitas paket npm JavaScript

Periksa kompatibilitas
perry check ./src

Validasi kode TypeScript untuk kompilasi native

Dukungan Fitur

Cakupan API TypeScript dan Node.js yang komprehensif

Core Language

  • Numbers64-bit floating point (f64)
  • StringsUTF-8, all common methods
  • Booleanstrue/false, logical operators
  • ArraysTyped and mixed-type arrays
  • ObjectsObject literals and field access
  • BigInt256-bit integer support
  • EnumsNumeric and string enums

Functions

  • Function DeclarationNamed functions
  • Arrow Functions() => {} syntax
  • Default ParametersParameters with defaults
  • Rest Parameters...args syntax
  • ClosuresIncluding mutable captures
  • Higher-Order FunctionsFunctions as arguments/returns
  • Async/AwaitAsync function support

Classes

  • Class DeclarationBasic class syntax
  • ConstructorsWith parameters
  • Private Fields (#)ES2022 #privateField syntax
  • Static Methods/FieldsClass-level members
  • Getters/Settersget/set accessors
  • Inheritanceextends keyword
  • Super Callssuper() constructor calls

Type System

  • Type AnnotationsExplicit type declarations
  • Type InferenceAutomatic type detection
  • GenericsMonomorphization (like Rust)
  • InterfacesInterface declarations
  • Union Typesstring | number support
  • Type Guardstypeof operator
  • Type Aliasestype X = ... declarations

Standard Library

  • fsreadFileSync, writeFileSync, existsSync, etc.
  • pathjoin, dirname, basename, extname, resolve
  • cryptorandomBytes, randomUUID, sha256, md5
  • osplatform, arch, hostname, memory info
  • Bufferfrom, alloc, toString, slice, copy
  • child_processexecSync, spawnSync
  • JSON/Math/DateFull implementations
Dukungan Penuh
Sebagian

30+ Paket npm Native

Paket npm populer diimplementasi ulang dalam Rust native. Tanpa npm install, tanpa node_modules, hanya kode native yang cepat.

Database

mysql2pgmongodbbetter-sqlite3ioredis

Keamanan

bcryptargon2jsonwebtokencrypto

HTTP

httphttpsaxiosnode-fetchwsnodemailer

Pemrosesan Data

cheeriosharpzliblodash

Tanggal & Waktu

dayjsmomentdate-fnsnode-cron

Utilitas

uuidnanoidslugifyvalidatordotenvrate-limiter-flexible
Cukup import dan gunakan — Perry secara otomatis menggunakan implementasi native

Dari Kode ke App Store

Perry tidak hanya mengompilasi aplikasi Anda — tetapi juga mengantarkannya ke tangan pengguna.

perry buildKompilasi & tanda tangani
perry publishKemas & kirim
Toko & UnduhanApp Store, Play Store, langsung
perry verifyUji setiap platform

Build & Tanda Tangani

Build lintas platform dengan satu perintah. Penandatanganan kode untuk macOS, iOS, Android, dan Windows ditangani untuk Anda. Tidak perlu bergulat dengan provisioning profile Xcode atau keystore Android.

Distribusi

Push ke App Store, Play Store, atau kirim unduhan langsung. Perry Publish menangani pengemasan, notarisasi, dan pengiriman.

Verifikasi

Didukung oleh Geisterhand. Pengujian UI otomatis di semua 6 platform. Ketahui bahwa aplikasi Anda bekerja di mana saja sebelum pengguna memberi tahu Anda bahwa tidak.

Gratis untuk proyek open source. Paket untuk tim → /publish

Cara Kerjanya

Dari kode sumber TypeScript ke executable native dalam hitungan detik

TypeScriptFile .ts
SWC
ParserParsing cepat
HIR
TransformasiMonomorphization
Crane
lift
CodegenKode mesin
ExecutableBinary 2-5 MB

Ingin tahu bagaimana kompiler bekerja di balik layar? Struktur internal kompiler