Introduction
In the world of software development, TypeScript has become an indispensable language for many developers. However, the performance of applications developed with TypeScript can be limited by dependencies on runtimes like Node.js. Perry changes the game by compiling TypeScript directly into native executables, using SWC and LLVM. Let’s explore how this works and why it could be a game changer for your projects.
Perry: A New Era for TypeScript
Perry offers the ability to compile TypeScript applications into native executables on all major platforms, including macOS, Windows, iOS, and Android. Unlike solutions like Electron that rely on heavy runtimes, Perry produces lightweight binaries, often between 2 to 5 MB, allowing for quick deployments and performant execution.
No Runtime Required
One of Perry's greatest advantages is its ability to eliminate the need for runtimes like Node.js or V8. By compiling directly into native code, Perry ensures performance close to applications written in C or C++. This is made possible by using SWC for parsing and LLVM for optimized code generation.
Compact Binaries
The size of the generated binaries is typically 2 to 5 MB. Even with the option to integrate the V8 runtime for npm JavaScript packages, the size remains relatively small at 15 to 20 MB. This means your applications can be deployed faster and take up less space on the client.
Performance and Efficiency
Perry surpasses Node and Bun in most benchmarks, thanks to its generational garbage collector and efficient memory management. Moreover, the absence of a runtime means that startup time is nearly instantaneous, with applications ready to use immediately upon launch.
Advanced Features
Perry offers a comprehensive standard library with native implementations of popular modules like fs, crypto, and child_process. Additionally, it supports 25+ native UI widgets, enabling the development of rich and interactive user interfaces.
True Multithreading
With Perry, you have access to real multithreading, using the operating system's threads. This allows for efficient parallel operations without the complications of workers or shared buffers.
Why Choose Perry?
For developers looking to maximize the performance of their TypeScript applications, Perry provides a robust solution. Not only does it eliminate heavy dependencies, but it also ensures deterministic builds, guaranteeing that the same input always produces the same binary.
Real-World Use Case
Take the example of Mango, a native GUI for MongoDB, which benefits from a cold start in under a second with a binary of about 7 MB. This showcases the potential of Perry for applications requiring quick and efficient database interactions.
Conclusion
Perry transforms the way we develop and deploy TypeScript applications. By eliminating runtimes and producing native executables, Perry paves the way for lighter, faster, and easier-to-distribute applications. Ready to explore the possibilities Perry offers?
Let's discuss your project in 15 minutes.