Perry
vi
v0.5.306 — GC theo thế hệ + lazy JSON tape mặc định, nhanh hơn Node và Bun ở hầu hết benchmark

Một mã nguồn. Mọi nền tảng.
Hiệu năng gốc.

Perry biên dịch TypeScript thành ứng dụng GUI và CLI gốc trên macOS, iPadOS, iOS, Android, Linux, Windows, watchOS, tvOS, WebAssembly và Web. Không cần runtime. Không cần Electron. Chỉ là binary gốc.

terminal
$ perry compile main.ts
Đang biên dịch main.ts...
✓ Tệp thực thi đã biên dịch: main (2,3 MB)

$ ./main
Hello, World!
10
Mục tiêu
25+
Widget UI gốc
<50 ms
Thời gian khởi động
App Store
Sẵn sàng

Tại sao chọn Perry?

Mọi thứ bạn cần để biên dịch TypeScript thành ứng dụng gốc

noRuntime
fastCompilation
smallBinaries
deterministicBuilds
stdLib
v8Runtime
widgets
plugins
threading
i18n

Xem mọi người xây dựng

Ứng dụng native thực sự, biên dịch từ TypeScript. Không Electron, không web view — chỉ UI native trên mọi nền tảng.

Mango

Mango

GUI MongoDB native — xây dựng hoàn toàn bằng TypeScript

macOSLinuxWindows
Mango — document editor
Mango — query explorer
Hone

Hone

Trình soạn thảo code native hỗ trợ AI — TypeScript sang binary native

macOSiOSWeb
Hone — native AI code editor

Gốc trên mọi nền tảng

Perry biên dịch TypeScript của bạn thành framework UI gốc, WebAssembly và JavaScript — không phải web view, không phải Electron. Widget gốc thực sự trên mọi nền tảng, cộng thêm web.

🍎
macOS
Ổn định
📱
iOS
Ổn định
📲
iPadOS
Ổn định
watchOS
Ổn định
📺
tvOS
Ổn định
🤖
Android
Ổn định
🐧
Linux
Ổn định
🪟
Windows
Ổn định
🌐
Wasm
Ổn định
💻
Web
Ổn định

Từ mã nguồn đến App Store

Perry không chỉ biên dịch ứng dụng — mà còn đưa nó đến tay người dùng.

perry compileBiên dịch và ký
perry publishĐóng gói và gửi
Cửa hàng và tải vềApp Store, Play Store, trực tiếp
perry verifyKiểm thử mọi nền tảng

Build và Ký

Build đa nền tảng chỉ với một lệnh. Ký mã cho macOS, iOS, Android và Windows được xử lý cho bạn. Không cần vật lộn với provisioning profile của Xcode hay keystore của Android.

Phân phối

Đẩy lên App Store, Play Store hoặc cung cấp tải trực tiếp. Perry Publish xử lý đóng gói, công chứng và gửi.

Xác minh

Được hỗ trợ bởi Geisterhand. Kiểm thử UI tự động trên cả 6 nền tảng. Biết rằng ứng dụng của bạn hoạt động ở mọi nơi trước khi người dùng nói cho bạn biết nó không.

Miễn phí cho dự án mã nguồn mở. Gói cho nhóm → /publish

So sánh framework

Framework duy nhất đáp ứng mọi tiêu chí

TypeScript biên dịch sang mã gốc. Widget nền tảng thực sự. Không có chi phí runtime.

FrameworkNgôn ngữMã gốcWidget gốcChi phí runtime
PerryTypeScript✓ Biên dịch gốc✓ Widget nền tảng thực sự✓ Không có chi phí runtime
React NativeJS / TSJS bridgeMột phầnJS engine + bridge
FlutterDartAOTKhông có UI dùng chungDart VM
ElectronJS / TSChromium runtimeHTML mimicsChromium + Node

Viết TypeScript, xuất bản gốc

Sử dụng cú pháp và API TypeScript quen thuộc. Perry lo phần còn lại.

hello.ts
// hello.ts
const greeting = "Hello, World!";
console.log(greeting);

// Compiles to ~2MB native executable
// No runtime needed!
$ perry build hello.ts
Binary gốc

So sánh hiệu năng

Biên dịch gốc mang lại hiệu quả vượt trội

Kích thước binary
1.8 MB
Bun 96 MB · Node 110 MB
Thời gian khởi động
<50 ms
Bun ~200 ms · Node ~800 ms
Phụ thuộc runtime
Không có
Bun + Node need runtimes
Chi phí bộ nhớ
Tối thiểu
Bun ~80 MB · Node ~120 MB

Bắt đầu

Cài đặt Perry và bắt đầu biên dịch TypeScript thành tệp thực thi gốc

Homebrew (macOS)

brew install perry-ts/perry
Yêu cầu Homebrew. Hỗ trợ macOS arm64 và x86_64.

APT (Debian/Ubuntu)

apt-get install perry
Hỗ trợ Linux x86_64 và arm64.

Windows (winget)

scoop install perry-ts/perry
Yêu cầu Windows Package Manager. Hỗ trợ Windows x86_64 và arm64.

Hỗ trợ tính năng

Bao phủ toàn diện API TypeScript và Node.js

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-OrderFunctions 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
Hỗ trợ đầy đủ
Một phần

Hơn 30 gói npm gốc

Các gói npm phổ biến được triển khai lại bằng Rust gốc. Không npm install, không node_modules, chỉ có mã gốc nhanh.

Cơ sở dữ liệu

mysql2pgmongodbbetter-sqlite3ioredis

Bảo mật

bcryptargon2jsonwebtokencrypto

HTTP

httphttpsaxiosnode-fetchwsnodemailer

Xử lý dữ liệu

cheeriosharpzliblodash

Ngày và giờ

dayjsmomentdate-fnsnode-cron

Tiện ích

uuidnanoidslugifyvalidatordotenvrate-limiter-flexible
Chỉ cần import và sử dụng — Perry tự động dùng triển khai gốc

Cách hoạt động

Từ mã nguồn TypeScript đến tệp thực thi gốc chỉ trong vài giây

TypeScriptTệp .ts
SWC
Bộ phân tíchPhân tích nhanh
HIR
Chuyển đổiMonomorphization
LLVM
Sinh mãMã máy
Tệp thực thiBinary 2-5 MB

Muốn biết trình biên dịch hoạt động bên trong như thế nào? Cấu trúc bên trong trình biên dịch