Perry vs Electron
Electron lets you build cross-platform desktop apps using web technologies (HTML/CSS/JS) by bundling Chromium and Node.js with your app. Perry compiles TypeScript directly to native machine code and renders UI through real platform widgets — AppKit, UIKit, GTK4, Win32, JNI. Electron's pitch is web-tech reuse; Perry's pitch is small native binaries with native UI from TypeScript.
What is Electron?
Electron is an open-source framework for building cross-platform desktop applications using Chromium for rendering and Node.js for system access. Each Electron app ships with its own copy of Chromium and Node, which is why Electron app installers are typically 80–150 MB even for a hello world. Electron has powered widely-used apps including VS Code, Slack, Discord, and Figma's desktop client. It targets Linux, macOS, and Windows desktops; there is no first-party mobile, watch, or TV story.
What is Perry?
Perry compiles TypeScript directly to native machine code with no browser engine, no Chromium, and no Node runtime. The UI layer (perry/ui) is a SwiftUI-style declarative system that maps to native platform widgets via AppKit on macOS, UIKit on iOS/iPadOS/tvOS, GTK4 on Linux, Win32 on Windows, and JNI on Android. Hello-world binaries are ~330 KB; full apps with stdlib (Fastify, mysql2, etc.) are around 48 MB.
Side by side
| Feature | Perry | Electron |
|---|---|---|
| Rendering | Native platform widgets (AppKit, UIKit, GTK4, Win32, JNI) | Bundled Chromium (HTML/CSS/JS) |
| Engines bundled | None (optional V8 only when --enable-js-runtime) | Chromium + Node.js |
| Hello-world installer size | ~330 KB | ~80–150 MB |
| Full-app installer (stdlib + frameworks) | ~48 MB | 100–200+ MB typical |
| RAM usage | Native (typical: tens of MB) | Multiple Chromium processes (typical: hundreds of MB) |
| Mobile / watch / TV | Yes — iOS, iPadOS, Android, watchOS, tvOS, Wear OS | No (desktop only) |
| UI language | TypeScript with declarative SwiftUI-style API | HTML/CSS/JS (web stack) |
| Auto-update / packaging | perry publish (Homebrew, APT, App Store, Play Store) | electron-builder, electron-updater (mature ecosystem) |
| Maturity | Pre-1.0 | Stable, decade+ in production |
Where Perry wins
- +Binary size. A Perry hello world is ~330 KB; an Electron hello world is typically 80–150 MB because every app ships its own Chromium.
- +Memory footprint. Perry apps run as a single native process; Electron apps run multiple Chromium processes (renderer, GPU, utility, etc.) and consume hundreds of MB of RAM at idle.
- +Native look and feel. Perry renders through real platform widgets, so apps inherit OS conventions (focus rings, accessibility, IME, scrolling physics) automatically.
- +Mobile, watch, TV. One Perry codebase compiles to iOS/iPadOS/Android/watchOS/tvOS/Wear OS. Electron is desktop only.
- +Cold start. Native binaries don't pay Chromium and Node startup cost.
- +Real CPU performance on tight code. Perry leads compute microbenches against Node (which Electron uses) by multiples on most kernels (see perry/benchmarks).
Where Electron wins
- +Maturity. Electron has been in production for over a decade and powers VS Code, Slack, Discord, and many other apps with battle-tested tooling.
- +Web stack reuse. If your team already builds web UIs, Electron lets you ship them as a desktop app with no rewrite.
- +UI consistency across platforms is easy — Chromium renders the same on every OS, which is exactly what some products want.
- +Vast ecosystem of npm libraries works at runtime; Perry runs a subset natively and opt-in V8 covers the rest.
- +Mature packaging tooling (electron-builder, electron-updater, code signing helpers) with broad community support.
- +Web-native features like devtools, hot reload, and fluid CSS/HTML iteration speed are unmatched.
When to choose Perry
Choose Perry if you want small native binaries, low memory usage, native look-and-feel per platform, or a single TypeScript codebase that ships to mobile/watch/TV in addition to desktop.
When to choose Electron
Choose Electron if you have an existing web UI and want to ship it as a desktop app with minimal rewrite, if you need maximum cross-platform UI consistency on desktop, or if you depend on a wide range of pure-JS libraries at runtime.
Verdict
Electron and Perry sit at opposite ends of the cross-platform spectrum. Electron trades binary size and memory for web-tech reuse; Perry trades the web stack for native binaries and native UI. If you've watched your Electron app's installer balloon past 150 MB or its idle RAM past half a gigabyte, Perry is the answer to that specific problem — at the cost of a different, native-style UI model.