Skip to content
HN On Hacker News ↗

Perry — TypeScript → Native

▲ 125 points 104 comments by 0x1997 3mo ago HN discussion ↗

Pangram verdict · v3.3

We believe that this document is a mix of AI-generated, AI-assisted, and human-written content

88 %

AI likelihood · overall

Mixed
0% human-written 74% AI-generated
SEGMENTS · HUMAN 0 of 4
SEGMENTS · AI 3 of 4
WORD COUNT 803
PEAK AI % 99% · §1
Analyzed
May 30
backend: pangram/v3.3
Segments scanned
4 windows
avg 201 words each
Distribution
0 / 74%
human / AI fraction
Verdict
Mixed
Pangram v3.3

Article text · 803 words · 4 segments analyzed

Human AI-generated
§1 AI · 99%

v0.5.306 — generational GC + lazy JSON tape default, faster than Node and Bun on most benchmarksOne Codebase. Every Platform.Native Performance.Perry compiles TypeScript to native GUI and CLI apps on macOS, iPadOS, iOS, Android, Linux, Windows, watchOS, tvOS, WebAssembly, and the Web. No runtime. No Electron. Just native binaries.Get StartedView on GitHubterminal$ perry compile main.tsCompiling main.ts...✓ Compiled executable: main (2.3 MB)$ ./mainHello, World!10Targets25+Native UI widgets0 msStartup timeApp StoreReadyWhy Perry?Everything you need to compile TypeScript to native applicationsNo Runtime RequiredProduces standalone native executables. No Node.js, no V8, no runtime dependencies. Just a single binary that runs anywhere.Fast CompilationDirect TypeScript to native code compilation using SWC for parsing and LLVM for optimized code generation. No intermediate JavaScript.Small BinariesOutput binaries are typically 2-5MB. With optional V8 runtime for JS npm packages, 15-20MB. Ship less, deploy faster.Deterministic BuildsSame input, same binary. Reproducible across machines, across CI runs, across teams. No mystery rebuilds.Comprehensive Standard LibraryBuilt-in native implementations of fs, path, crypto, os, Buffer, child_process, and more. Use familiar Node.js APIs.Optional V8 RuntimeNeed to use a pure JavaScript npm package? Enable the V8 runtime flag for full npm ecosystem compatibility.25+ Native UI WidgetsButtons, text fields, text areas, tables, canvas, scroll views, QR codes, secure fields, splash screens, and more — all compiling to real platform widgets via AppKit, GTK4, Win32, UIKit, and JNI.Compile-Time Plugin SystemModules compose at build time — no runtime plugin overhead, no IPC boundaries. Your dependencies become direct native function calls in the final binary.True Multi-ThreadingReal OS threads with parallelMap, parallelFilter, and spawn. Compile-time safety rejects mutable captures — no SharedArrayBuffer, no workers, just threads.Compile-Time i18nAutomatic string extraction, CLDR plural rules for 30+ locales, compile-time validation. Translations baked into the binary with near-zero runtime lookup.

§2 AI · 99%

Native on Every PlatformPerry compiles your TypeScript to native UI frameworks, WebAssembly, and JavaScript — not web views, not Electron. Real native widgets on every platform, plus the web.macOSAppKitStableiOSUIKitStableiPadOSUIKitStableAndroidViewsStableLinuxGTK4StableWindowsWin32StablewatchOSSwiftUIStabletvOSSwiftUIStableWASMWebAssemblyStableWebJavaScriptStableFrom Code to App StorePerry doesn't just compile your app — it gets it into your users' hands.Build & SignCross-platform builds from one command. Code signing for macOS, iOS, Android, and Windows handled for you. No wrestling with Xcode provisioning profiles or Android keystores.DistributePush to the App Store, Play Store, or ship direct downloads. Perry Publish handles packaging, notarization, and submission.VerifyPowered by Geisterhand. Automated UI testing across all 6 platforms. Know your app works everywhere before your users tell you it doesn't.Free for open-source projects. Plans for teams → /publishFramework ComparisonThe only framework that checks every boxTypeScript compiled to native code. Real platform widgets. No runtime overhead.FrameworkLanguageNative CodeNative WidgetsRuntime OverheadPerry★AOT compiled to native binaryTypeScriptNoneReact NativeJIT / interpreted at runtimeJS / TypeScriptHermes / V8 + BridgeFlutterAOT compiled, custom rendererDartDart VM + Skia engineKMP + ComposeJVM on Android, native on iOSKotlinPartialKotlin runtime + SkiaSwift for AndroidNative binary, no shared UISwiftNo shared UISwift runtime on Android.NET MAUIPartial AOT via MonoC#Partial.NET / Mono runtimeNativeScriptJS runtime, native widget accessJS / TypeScriptV8 / JavaScriptCoreIonicWeb app in native wrapperJS / TypeScriptWebView + CapacitorNative compiledReal platform widgetsZero runtime overheadWrite TypeScript, Ship NativeUse familiar TypeScript syntax and APIs.

§3 AI · 88%

Perry handles the rest.hello.ts// hello.tsconst greeting = "Hello, World!";console.log(greeting);// Compiles to ~2MB native executable// No runtime needed!$ perry build hello.tsNative binaryPerformance ComparisonNative compilation delivers unmatched efficiencyMetricPerryNode.jsBunBinary Size2-5 MB~80 MB~90 MBStartup Time~1 ms~30 ms~10 msRuntime DependenciesNoneNode.jsBunMemory OverheadMinimalV8 + GCJSC + GCBenchmark Results: Up to 18x FasterPerry v0.5.279 vs Node.js v25 — RUNS=11 median, Apple M1 Max (lower is better)accumulate18x34ms vs 617msobject create11x1ms vs 11msjson roundtrip5.3x75ms vs 394msloop overhead4.5x12ms vs 54msmath intensive3.6x14ms vs 51msarray read3.3x4ms vs 13msfibonacci3.2x318ms vs 1022msarray write2.3x4ms vs 9msloop data dependent1.4x235ms vs 322msnested loops1.0x18ms vs 18msBinary SizeLower is betterPerryNode.jsBunGet StartedInstall Perry and start compiling TypeScript to native executables1Installationterminal$ brew tap PerryTS/perry$ brew install perryRequires Homebrew. Supports macOS arm64 and x86_64.2UsageCompile a fileperry compile main.tsCompiles main.ts to a native executableCustom outputperry compile main.ts -o myappSpecify the output executable nameWith V8 runtimeperry compile main.ts --enable-js-runtimeEnable V8 for JavaScript npm package compatibilityCheck compatibilityperry check ./srcValidate TypeScript code for native compilationFeature SupportComprehensive TypeScript and Node.js API coverageCore LanguageNumbers64-bit

§4 Mixed · 64%

floating point (f64)StringsUTF-8, all common methodsBooleanstrue/false, logical operatorsArraysTyped and mixed-type arraysObjectsObject literals and field accessBigInt256-bit integer supportEnumsNumeric and string enumsFunctionsFunction DeclarationNamed functionsArrow Functions() => {} syntaxDefault ParametersParameters with defaultsRest Parameters...args syntaxClosuresIncluding mutable capturesHigher-Order FunctionsFunctions as arguments/returnsAsync/AwaitAsync function supportClassesClass DeclarationBasic class syntaxConstructorsWith parametersPrivate Fields (#)ES2022 #privateField syntaxStatic Methods/FieldsClass-level membersGetters/Settersget/set accessorsInheritanceextends keywordSuper Callssuper() constructor callsType SystemType AnnotationsExplicit type declarationsType InferenceAutomatic type detectionGenericsMonomorphization (like Rust)InterfacesInterface declarationsUnion Typesstring | number supportType Guardstypeof operatorType Aliasestype X = ... declarationsStandard LibraryfsreadFileSync, writeFileSync, existsSync, etc.pathjoin, dirname, basename, extname, resolvecryptorandomBytes, randomUUID, sha256, md5osplatform, arch, hostname, memory infoBufferfrom, alloc, toString, slice, copychild_processexecSync, spawnSyncJSON/Math/DateFull implementationsFull SupportPartial30+ Native npm PackagesPopular npm packages reimplemented in native Rust. No npm install, no node_modules, just fast native code.mysql2pgmongodbbetter-sqlite3ioredisbcryptargon2jsonwebtokencryptohttphttpsaxiosnode-fetchwsnodemailercheeriosharpzliblodashdayjsmomentdate-fnsnode-cronuuidnanoidslugifyvalidatordotenvrate-limiter-flexibleJust import and use - Perry automatically uses the native implementationHow It WorksFrom TypeScript source to native executable in secondsTypeScript.ts filesSWCParserFast parsingHIRTransformMonomorphizationLLVMCodegenMachine codeExecutable2-5 MB binaryWant to know how the compiler works under the hood? Compiler internals