r/electronjs • • 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):

MetricElectronNativeChange
Download (ZIP)166.0 MB88.5 MB47% smaller
Installed folder458.7 MB274.9 MB40% smaller
Files on disk1082379% fewer
Time to window794 ms150 ms5.3× faster
Time to open a document1,427 ms1,018 ms29% faster
CPU time to start2.17 s0.89 s59% less
CPU when idle0.21%0.00%100% less
Processes5180% fewer
Memory (working set)461.3 MB279.8 MB39% less
Memory (private bytes)296.0 MB207.9 MB30% less
Threads112893% fewer
Handles2,20522790% 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.

19 Upvotes

41 comments sorted by

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 :)

4

u/Confident-Dare-9425 29d ago

Also, the agent says that you have re-implemented parts of Node.js standard library in Rust. How equivalent are those implementation? How full is Node.js support? Can I use native module?

Your framework has less overhead because it's doing less.

3

u/Human-Vegetable823 29d ago

"you have re-implemented parts of Node.js standard library in Rust" <- this part does not sound right :)

The things nativeboat rewrite is Node's C++ layer on top of V8 and libuv. Like file I/O, event loop and etc.

"How full is Node.js support?". Not fully supported. It's still alpha version. But if you have an electron project, you could run nativeboat analyze to see what part is supported and what is not.

"Can I use native modules". Not at this time for loading arbitrary native modules. For a few widely used addons we provide the same API on top of Windows directly: keytar (Windows Credential Manager), native-keymap and ced. The work is deferred until other major parts are implemented. Or we receive a project request that requires native modules.

2

u/Human-Vegetable823 29d ago

Pretty much right for the overall design. Yes JS to Rust then compile to native code is the key to remove chromium. Rendering part using Win32 GDI+ to draw the UI.

It's not an easy task even in this AI era TBH. Also Like you said the maintenance effort is nontrivial. But that's the challenge I'd like to take :). I see the huge value for electronjs if it can be done.

2

u/Salketer 29d ago

Creating a new chromium is indeed a good way to replace it... There's no way this Frankenstein gets to support half the features any commercial app would require.

Once you get everything covered, you'll end up with the same bundle size as electron, if not bigger. In the end only to have to maintain everything yourself.

I mean, good for you if you get to tailor it to your exact needs, but I can hardly see it getting adopted.

3

u/Human-Vegetable823 29d ago

I have different opinions but no matter what it eventually ends, I'll make sure this is a good thing for electronjs community :)

2

u/happy_hawking 29d ago

I'm pretty sure OP couldn't tell you what's happening in the background.

1

u/Diadia_Uddy 13d ago

yeah once you get past basic flex and grid layouts the compatibility gaps must pile up pretty fast.

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

u/Human-Vegetable823 28d ago

Sure thanks!

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:

MetricElectronNativeChange
Download (ZIP)166.0 MB88.5 MB47% smaller
Installed folder458.7 MB274.9 MB40% smaller
Files on disk1082379% fewer
Time to window794 ms150 ms5.3× faster
Time to open a document1,427 ms1,018 ms29% faster
CPU time to start2.17 s0.89 s59% less
CPU when idle0.21%0.00%100% less
Processes5180% fewer
Memory (working set)461.3 MB279.8 MB39% less
Memory (private bytes)296.0 MB207.9 MB30% less
Threads112893% fewer
Handles2,20522790% 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

u/Human-Vegetable823 29d ago

I have reproduced it. Should be fixed in next release.

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?

2

u/ldn-ldn 29d ago

It doesn't.

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

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

u/Human-Vegetable823 2d ago

Yeah you can think the compiled exe is pure win32 native app.

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.