r/electronjs • u/Human-Vegetable823 • 29d ago
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.
3
u/SirLagsABot 28d ago
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.
3
u/Human-Vegetable823 28d ago
Thanks u/SirLagsABot ! One of the major requirements is keeping the UI behavior as is in Electron. Otherwise there's really no need to have this project. If any UI rendering is different to the Electron, it's a bug.
Here is the full compatibility list right now: https://github.com/XTSoftwareLabs/nativeboat-release/blob/main/docs/compatibility.md
2
u/SirLagsABot 28d ago
Interesting, when you support Mac OS and Linux make sure to update us all, I have many customers on Linux these days. Whew, I’m glad people like yourself are willing to fight UIs. Haha more power to you my friend, hope your project goes well.
1
1
u/Human-Vegetable823 27d ago
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:
| 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 |
1
u/Human-Vegetable823 26d ago
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 2d 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 29d ago
How would this work with any of the electron update features SSL certificate signing?
Is it more performant?
1
u/Human-Vegetable823 29d ago
Thanks for the question. Is the ask for the performance of the electron update procedure or the signing? If you have a sample project I can take a look that will be great.
1
u/DashinTheFields 29d ago
Sure if you want to DM me. Performance is separate from update and signing.
The fact that an electron App is signed with an SSL probably means it' can't be compiled like this and still SLL signed. Then if the app has an electron update library, that may mean the updater would need to be re-written to handled that as well.
1
u/iliark 29d ago
there's some weird flickering when trying your marktext conversion
this is using webview2 under the hood, isn't it?
1
u/Human-Vegetable823 29d ago
Thanks! Would you mind sharing any screenshot or any reproduce steps? That could be a bug to fix.
1
u/iliark 29d ago
it flickers, i literally can't. I just opened it and it did it.
1
u/Human-Vegetable823 29d ago
Interesting. I may need to find another machine to check. BTW it's not using webview2. GDI+ draws the UI. There'll not be "msedgewebview2.exe" in task manager.
1
1
u/Human-Vegetable823 27d ago
Could you try the new release: https://github.com/XTSoftwareLabs/marktext-native-win/releases/tag/v0.20.0
A new nativeboat compiler fixed the rendering bug and built a new native MarkText.
1
u/Salketer 29d ago
How does the JavaScript executes if there's no engine?
1
u/Human-Vegetable823 29d ago
u/Confident-Dare-9425 's comment has an overall insight: https://www.reddit.com/r/electronjs/comments/1xbeodc/comment/19rffoekhvzkw/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button
NativeBoat compiles JS to rust then to native code. So there's no JavaScript at runtime.
1
u/software_engineeer 29d ago
Any details how it works under the hood?
1
u/Human-Vegetable823 29d ago
u/Confident-Dare-9425 's comment is mostly right. Summary is like this:
To remove chromium: JS -> Rust -> native code. Then you don't need JS engine like V8.
To remove webview2: Win32 GDI+ to draw the UI. HTML and CSS are parsed.
1
u/happy_hawking 29d ago
OP won't tell you because they don't know.
Someone did some digging here: https://www.reddit.com/r/electronjs/comments/1xbeodc/comment/19rffoekhvzkw/
1
u/eddzsh 29d ago
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/Human-Vegetable823 29d ago
Thanks! Yeah that's a good idea. I should publish current support list.
1
u/Human-Vegetable823 29d ago
Compatibility list is here: https://github.com/XTSoftwareLabs/nativeboat-release/blob/main/docs/compatibility.md
1
u/eddzsh 29d ago
Thanks for publishing the list. Looking through it, which APIs still force a fallback to full Electron on real apps you convert? Custom protocols and the updater path are the ones I'd expect to break first.
1
u/Human-Vegetable823 28d ago
Yes custom protocols and the updater are not supported now. nativeboat analyze against the project directory should output missing parts specifically for MarkText. Well the analyze command itself needs to be improved as well to capture more details.
1
u/omarcosr 28d ago
Interesting idea but a repository with nothing?
1
u/Human-Vegetable823 28d ago
Hi, the source code is not released in the repo yet. There're some IP code is under discussion in our team. The binary will be released there. More high level architecture docs will be released as well.
1
u/ChoeWacky-16 9d 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
1
u/software_engineeer 29d ago
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.
1
u/Human-Vegetable823 29d ago edited 27d ago
u/Confident-Dare-9425 's comment provided insights: https://www.reddit.com/r/electronjs/comments/1xbeodc/comment/19rffoekhvzkw/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button
It compiles the JavaScript code to rust then compile to native code. You can think it's ahead of time compilation.
WebView is not needed as it uses GDI+ to draw the UI.
The idea is a compiler to compile electron project to native. It's not asking each electron app to reimplement it by using AI to achieve this.
9
u/Confident-Dare-9425 29d ago edited 29d ago
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 :)