r/javascript • u/DetailAdventurous315 • May 10 '26
BlueJS - Compile JavaScript to 1.2MB native binaries (no V8)
https://bluejs.devUPDATE: The repository is now completely public. You can check out the source code here: https://github.com/bluejs-team/BlueJS/
The Problem: We’ve normalized shipping 150MB Electron apps and 50MB runtimes just to open a simple window or read a file. I got tired of the bloat, so I built BlueJS.
BlueJS isn't a wrapper; it's an Ahead-Of-Time (AOT) compiler that translates a strict subset of JavaScript directly to C++, links it, and strips the engine out entirely.
The Specs:
- Binary Size: 1.2 MB standalone (no runtime/V8 needed).
- Startup: ~5ms (compared to ~90ms for Node).
- Memory: 3.8 MB peak RSS.
- Native UI: Built-in support for OS windows and dialogs (GTK/WebView2) without Chromium.
How it works: It uses a "Hybrid Mode." Performance-critical code and UI are compiled AOT. For npm compatibility, it uses an embedded QuickJS "island" that handles pure-JS packages. The bluejs.dev site itself is actually served by a single 1.4MB Blue binary.
Try it out: The compiler is in a closed beta, but on top of the Windows/Linux binaries I set up a GitHub Codespace sandbox so anyone can verify these benchmarks and inspect the generated C++ in a safe, cloud environment:
Try the Playground: https://github.com/bluejs-team/Bluejs-playground
I’ll be hanging out in the comments to answer any questions!
View all comments
Show parent comment
1
u/vilhelmsjolund May 11 '26
Thanks, I will read the AOT part. But intuitively, wouldn't Typescript support basically just make the type inferral process a million times easier than chasing where arguments are passed? It really makes me wonder how that would work for any medium to large size code base, wouldn't that tank the compiler performance if you try to figure out whether you can compile a certain argument to a C++ number, when it's called through 24 layers?
In reality, very likely you would need both anyway, but I think the idea for broader ecosystem support by trying to compile JavaScript makes it less available for the ecosystem as the complexity of that likely grows exponentially?
Have you tried the compiler performance on some medium/large sized project and see what happens? This is just some constructive feedback, because I've done some projects myself where I was convinced about some concept, spent a month building it just to realize it doesn't scale... A "Pied Piper finale" moment so to speak...