Perry vs Bun
Both can produce a single executable, but the contents differ. Bun bundles the application with a copy of the Bun runtime. Perry compiles supported code to native machine code and statically links its own runtime and GC without a JavaScript engine by default.
技術的な事実と測定上の注意事項は、翻訳間のずれを防ぐため英語を正本として管理しています。
Bun とは?
Bun is an all-in-one JavaScript and TypeScript runtime, package manager, test runner, and bundler. Bun's official executable documentation says --compile bundles imported code and packages together with a copy of the Bun runtime.
Perry とは?
Perry parses TypeScript and JavaScript with SWC and compiles supported code ahead of time through LLVM. Native builds do not require an external Node.js installation or JavaScript engine, but they do statically link the Perry runtime and garbage collector. Perry is pre-1.0, implements a practical language and Node.js subset, and offers an optional embedded V8 fallback for code that needs engine semantics.
並べて比較
| 機能 | Perry | Bun |
|---|---|---|
| Execution model | LLVM ahead-of-time machine code | JavaScriptCore through the Bun runtime |
| Standalone executable | Target-specific native binary | Application plus a copy of the Bun runtime |
| Runtime model | Perry runtime + GC statically linked; no JS engine by default | Bun runtime and JavaScriptCore embedded |
| Documented targets | 11 targets plus HarmonyOS preview | Official --compile targets cover macOS, Linux, and Windows variants |
| Native UI | Platform widgets where supported | No built-in cross-platform native-widget layer |
| Package compatibility | Practical subset; optional V8 fallback | Broad Bun and Node API compatibility |
| Benchmark position | Wins, mixed results, and losses in the published suite | Wins several current suite rows, including prime sieve and matrix multiply |
Perry が優れている点
- +Mobile, wearable, TV, and Web/WASM targets
- +A native-widget UI model
- +No JavaScript engine in native output by default
- +Small outputs are possible when few features are linked
Bun が優れている点
- +More mature runtime and tooling ecosystem
- +Broader npm and dynamic JavaScript compatibility
- +Integrated package manager, test runner, and bundler
- +JIT execution can win on important workloads
Perry を選ぶべきとき
Choose Perry when native widgets or Perry's mobile, wearable, TV, and Web/WASM targets are central, and you can validate your code against Perry's current compatibility surface.
Bun を選ぶべきとき
Choose Bun when you need a mature all-in-one runtime, broad package compatibility, or its integrated package-manager, test, and bundling workflow.
結論
This is an architecture choice, not a universal speed ranking. Validate the exact workload, package graph, target, output size, and startup behavior you plan to ship.