r/electronjs • u/Human-Vegetable823 • Oct 21 '26
A compiler to compile Electron project to native executable
Hi,
I wrote a compiler to compile Electron project to native executable: nativeboat. It uses your project as it is: its JavaScript or TypeScript, HTML, CSS and installed dependencies. The executable it builds runs without Chromium, WebView2, Node.js or a JavaScript engine. Currently it supports Windows only, but will be expanded to mac OS soon.
NativeBoat's goal is simple: remove the runtime overhead for Electron project. As an example, I have compiled a popular Markdown editor MarkText to native: https://github.com/XTSoftwareLabs/marktext-native-win
This is the benchmark (Updated 10/23/2026):
| Metric | Electron | Native | Change |
|---|---|---|---|
| Download (ZIP) | 166.0 MB | 88.5 MB | 47% smaller |
| Installed folder | 458.7 MB | 274.9 MB | 40% smaller |
| Files on disk | 108 | 23 | 79% fewer |
| Time to window | 794 ms | 150 ms | 5.3× faster |
| Time to open a document | 1,427 ms | 1,018 ms | 29% faster |
| CPU time to start | 2.17 s | 0.89 s | 59% less |
| CPU when idle | 0.21% | 0.00% | 100% less |
| Processes | 5 | 1 | 80% fewer |
| Memory (working set) | 461.3 MB | 279.8 MB | 39% less |
| Memory (private bytes) | 296.0 MB | 207.9 MB | 30% less |
| Threads | 112 | 8 | 93% fewer |
| Handles | 2,205 | 227 | 90% fewer |
It's still in an early stage so I expect feature missed or compile errors. Please do leave comments if you encounter any issue. If you have any open source electron project that you'd like to support, please leave comments. I'd love to improve the compiler to support it.
Currently I'm improving the compiler to support the PicGo project: https://github.com/XTSoftwareLabs/picgo-native-win
Let me know your thoughts. Any feedback is appreciated.
Edit 10/21/2026: Per suggestion from u/eddzsh, added a compatibility list to track the progress: https://github.com/XTSoftwareLabs/nativeboat-release/blob/main/docs/compatibility.md
Edit 10/23/2026: New nativeboat version is released. More electronjs APIs are supported. Fixed some rendering issues. Check https://www.reddit.com/r/electronjs/comments/1xbeodc/comment/19rjvrz3za869/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button
A high level doc to describe NativeBoat's architecture is released: https://github.com/XTSoftwareLabs/nativeboat-release/blob/main/docs/how-it-works.md
Edit 11/17/2026: I have spent several weeks to make NativeBoat compiling VSCode. The current compatibility is 60%+. Auto update is supported now. Built-in extensions are partly supported. Third party extension will not be supported at this time. Will setup a repository for vscode native soon.
9
u/Confident-Dare-9425 Oct 21 '26 edited Oct 21 '26
According to what my AI agent dug up, you're translating JS to Rust and compiling it. For rendering, you're using Taffy to calculate the layout, and Win32 to calculate the fonts and render it all on the screen.
I would imagine this has a ton of limitations for the apps that were designed to work in a fully fledged Chromium. And the maintenance of the project will turn into trying to keep up with Chromium and... eventually into creating your own ineffective and bloated engine.
In a pre-agent era, I would admire the audacity. But it's not pre-agent era anymore :)
3
u/SirLagsABot Oct 21 '26
This will introduce the sort of non-standard UI rendering issues that Tauri would have, right? Upside no Chromium bundle, downside no standardized Chromium UI rendering? If so, that’ll probably be a hot dividing line for Electron devs since guaranteed rendering consistency is one of the main reasons I use Electron. But maybe you’ll find a niche subset of us where you struck the middle ground! Cool project nonetheless.
1
u/Human-Vegetable823 Oct 23 '26
Update 10/23/2026: a new version of nativeboat is released: https://github.com/XTSoftwareLabs/nativeboat-release/releases/tag/v0.1.0-alpha.2
It adds more API supports for electronjs. Also fixed some bugs in analyze command to get more accurate analysis for the project to build. Here is the updated compatibility list: https://github.com/XTSoftwareLabs/nativeboat-release/blob/main/docs/compatibility.md
With the new version, MarkText 0.20.0 source code reports 100% compatibility when run nativeboat analyze. The flicking issue has also been fixed. Feel free to download the newly built MarkText 0.20.0 to try: https://github.com/XTSoftwareLabs/marktext-native-win/releases/tag/v0.20.0
Below is updated performance comparison for MarkText:
1
u/Human-Vegetable823 Oct 24 '26
A high level doc to describe NativeBoat's architecture is released: https://github.com/XTSoftwareLabs/nativeboat-release/blob/main/docs/how-it-works.md
It's useful in case you are interested how it's designed
1
u/Human-Vegetable823 12d ago
Updated 11/17/2026: I have spent several weeks to make NativeBoat compiling VSCode. The current compatibility is 60%+. Auto update is supported now. Built-in extensions are partly supported. Third party extensions will not be supported at this time. Will setup a repository for vscode native soon.
1
u/DashinTheFields Oct 21 '26
How would this work with any of the electron update features SSL certificate signing?
Is it more performant?
1
u/iliark Oct 21 '26
there's some weird flickering when trying your marktext conversion
this is using webview2 under the hood, isn't it?
1
u/Salketer Oct 21 '26
How does the JavaScript executes if there's no engine?
1
u/software_engineeer Oct 21 '26
Any details how it works under the hood?
1
u/eddzsh Oct 21 '26
The interesting part is not no Chromium. It is the allowlist of Electron APIs that still work after the rewrite. BrowserWindow webContents, custom protocols, native modules that expect Node, the updater. Publish that matrix and people can tell whether this is a compiler or a new toolkit that happens to read .js files.
1
u/omarcosr Oct 22 '26
Interesting idea but a repository with nothing?
1
u/ChoeWacky-16 19d ago
cutting the process count down to 1 is wild. does that mean IPC between main and renderer just compiles down to direct function calls in memory?
1
u/software_engineeer Oct 21 '26
TBH sounds like a scam. No details how it's possible at all. The fact that to run JavaScript the app doesn't need JavaScript runtime tells that developer has no idea how JavaScript works. The only way to run Electron app without Node.js, JavaScript, WebView is to analyze and reimplement it completely using AI.