frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Show HN: Astra – a new js2exe compiler

https://github.com/astracompiler/cli
61•qwertycodepl•10mo ago
Hi everyone I'm new here and i wanted to introduce my project i've been working on. Astra is a simple but powerful node.js to exe compiler. It uses esbuild and Node SEA. It uses postject to inject your code to nodejs binary. It focuses more on compiling cli and Servers like pkg or nexe (express) than fullstack applications like electron or tauri. It has rich ESM and typescript support. It has good DX and cli UX. I made it bc i didn't like using pkg or nexe, they cause a lot of problems with esm.

LIMITATIONS: Now it has problems compiling projects with depencides containing binaries (e.g. bcrypt, rcedit), and it compiles only for Windows but i'm working on it

If you like it, leave a and comment what you think about it!

Comments

jasonjmcghee•10mo ago
To understand the underlying architecture- is my understanding correct that this runs esbuild to bundle then bundles that with node runtime and creates a binary that executes "node index.js"?
qwertycodepl•10mo ago
yes but it uses node SEA you can read about it here: https://nodejs.org/api/single-executable-applications.html
TheRealPomax•10mo ago
You probably want to put that information in your README.md, because there is barely any information in the readme, and the docs look to be a placeholder atm =)
qwertycodepl•10mo ago
thanks :)
belmarca•10mo ago
I clicked on this hoping for an actual compiler. However from what I can see this is a bundler. The name is confusing.
qwertycodepl•10mo ago
Thanks for the feedback! You're right - Astra is technically a bundler-to-executable tool, not a source-level compiler like Babel or TypeScript.

I called it a “compiler” in the sense that it transforms a JS project into a standalone .exe, similar to how tools like pkg or nexe are often described. That said, I’ll consider clarifying that in the description to avoid confusion. Appreciate the comment!

ymsodev•10mo ago
Honestly, I would drop calling compiler altogether -- it's just not a compiler. It doesn't make it any less cool though!
qwertycodepl•10mo ago
yeah it's not but i don't know how to call it. if i say it's bundler it will be more confusing in my opinion. waiting for your suggestions!
zamadatix•10mo ago
Sometimes the term "packager" is used instead of "bundler". Honestly though, "compiler" is the term most likely to cause any confusion. Even if one is not familiar with packagers/bundlers "js to exe ${unknown phrase}" still conveys things more clearly than "js to exe ${misleading phrase}".
belmarca•10mo ago
But it's definitely not a compiler! I think "Astra - a new js2exe bundler" is much less ambiguous because it's... a bundler!
qwertycodepl•10mo ago
https://astra-js.netlify.app/cli/faq/#thats-not-a-compiler-t...
quotemstr•10mo ago
Blame bun's --compile flag: https://bun.sh/docs/bundler/executables

We're probably going to have to live with "compiler" meaning "bundler" as an ongoing JavaScript-world neologism.

Vorh•10mo ago
Looks like a good start. A few notes:

- The first thing on the "features" list should be something that other compilers cannot do. Esthetics (maybe just say "DX"?) is a nice to have - sometimes VERY nice to have - but should not be positioned as the most important item.

As the original post says the alternatives have poor ESM support - that's a good differentiator.

- Even though ES Modules are part of the ECMAScript standard, having a header stating "(Partial) Support for ECMAScript"- to me, at least - indicates the project does not support base JS features, not that ESM imports have problems. Maybe say "improved ESM support"?

- Docs seem a little bare. For example, the Usage section says:

    # Preinstall Node.js on the target machine
    astra install
Which machine is the "target" machine? I would assume, in the context of compiling, that the target would be the machine you are compiling for... but installing software remotely seems out of scope. Does it install it locally, or swap the bundled installation in the .exe?

Also, no mention of binary limitations in actual docs, despite mention in post.

Hopefully this does not come off as discouraging - this looks like a good project.

qwertycodepl•10mo ago
Thanks for the feedback! I'm constantly working on the project. It's hard to do bc node sea is still an experimental feaurte and there's no much documentation about it, and i want to make it highest quality possible. And it's my first open-source project what's actually getting attention. I would really appreciate any help with this project!
thot_experiment•10mo ago
> Average exe is ~70-80MB (depends on your code) so it's lighter than most compilers

I know it's JS not actually a compiler but a bundler that just packs node in with your code, but I still had a nice laugh at 80mb being light. I suppose that's where the overton window is in a world of 1gb node_modules folders.

I wish there was a middle ground between this sort of thing and QuickJS (which is actually light, but has a lot of rough edges when it comes to its filesystem and network interfaces)

martinsnow•10mo ago
What's light enough when the average user in the western hemisphere has +300gb of storage?

I'm just asking since a 512gb disk has become the standard when ordering a laptop.

CleanCoder•10mo ago
The amount of functionality an application provides should be the benchmark for the size rather than one's available disk space. I'm sitting on 20TB+ of available storage and anything over 1MB for a simple "Hello World" is excessive.
johnisgood•10mo ago
Well, if we already could make something in 1 MB, why do we want to achieve the same thing with 100 MB? It is as if there is a mentality of "somehow the higher the size the better".
kube-system•10mo ago
In professional and enthusiast circles, yes, but I think you underestimate the popularity of cheap laptops.

e.g. currently only 2 of the top 10 selling laptops on Amazon have >=300GB storage.

https://www.amazon.com/Best-Sellers-Computers-Accessories-La...

Cheap laptops with a Celeron, 4 GB RAM, and 64 GB storage have been incredibly popular since that formula became popular a handful of years ago. As are base-model MacBook Airs.

TimTheTinker•10mo ago
Bun also supports this out of the box, and the overhead is likely a bit less (reportedly 30-40MB for a single `console.log` call with no further dependencies - I didn't verify that myself though).

https://bun.sh/docs/bundler/executables

I suspect a large portion of the executable size in both cases is for the ICU library for localization support (Note QuickJS has its own, much smaller l10n library.) It's possible to download a Node binary without ICU, which could trim ~30MB.

zamadatix•10mo ago
> reportedly 30-40MB for a single `console.log` call with no further dependencies - I didn't verify that myself though

I got a 110 MB exe for "console.log('test')" in "test.ts" using "bun build .\test.ts --compile --outfile test.exe". Pretty compressible though, on the order of 1/4th the size pretty easily. Considering it has zstd compression for sourcemaps that'd be an interesting option to add in.

dpcan•10mo ago
This is really interesting, got it up and running very quickly.

I'm not sure what the use case is and it doesn't auto-load chromium with its own web server from what I can tell. Is it just for creating javascript CLI utilities?

qwertycodepl•10mo ago
Yes, astra it's aiming to compile CLIs and servers (express, fastify etc.). It's not replacing electron.
zamadatix•10mo ago
Very interesting. The readme notes "Different than the others - Astra is a new approach to compiling JavaScript/TypeScript applications. It uses a different method than other compilers like pkg or nexe." but never really explains what the difference is. Is it just that the code is run through esbuild before the SEA step or is there some other "magic sauce"?
qwertycodepl•10mo ago
Yes it's just esbuild and SEA BUT that's actually the point. SEA is officialy supported by node.js and it constantly improves. Remember pkg and nexe supports only the older versions of node.js (~14) and astra supports the latest ones.

So in a way, the "magic sauce" it that it doesn't try to do anything fancy. I made astra beacuse i needed to compile js to exe for latest versions.

I wanted astra to be simple, built on official tools, and be future-proof.

quotemstr•10mo ago
This is not a compiler. It is doing no program translation. No register allocation. No parsing. No linking. It in no way resembles a compiler. Not every program that produces an executable file is a compiler just because some programs you may have heard of, like gcc, are in fact compilers.

I wish the JS universe would stop inventing new and wrong names for things.

(That said, this thing is at least using postject for actual insertion of the payload blob into the target executable, and based on its README, postjecth as the good taste to embed data as PE/ELF/Mach-O sections instead (as Bun does) of just YOLOing the attachment with cat.)

qwertycodepl•10mo ago
I totally understand your point - Astra doesn’t do register allocation or full parsing, so strictly speaking, it’s not a compiler in the traditional sense.

I used the term "compiler" because for many developers, it’s strongly associated with "turning source code into a single binary." That’s what Astra does at a practical level - even if it's technically just bundling and embedding into a node executable using SEA and postject.

quotemstr•10mo ago
> it’s strongly associated with "turning source code into a single binary."

Using things because they sound nice without thinking about whether they make sense is pretty much the whole JavaScript community. :)

Carrok•10mo ago
This whole thread was uncalled for honestly. It takes source, it makes an exe, that meets the definition for compiler to me. Your pedantry is not useful.
sleepdeep•10mo ago
How would you define the difference between a compiler and a linker?
dontlikeyoueith•10mo ago
This is just dishonest marketing then.
xhbxbsbebs•10mo ago
I don't get it, does this project do anything other than embedding js and node in a single executable?

Nothing wrong with that, but why call it a compiler instead of bundler which would make the intension obvious

qwertycodepl•10mo ago
https://astra-js.netlify.app/cli/faq/#thats-not-a-compiler-t...

ServiceMesh at Scale with William Morgan Creator of Linkerd

https://open.spotify.com/episode/6BbrYeuPftkvJYTZuJfZmm
1•neciudan•2m ago•1 comments

Show HN: Mail Toll – Set a price on your inbox, agents pay USDC to reach you

https://mailtoll.app
1•willgdjones•2m ago•0 comments

Macroeconomic Policy and the Optimal Destruction of Vampires [pdf]

https://irihs.ihs.ac.at/id/eprint/162/1/fo162.pdf
1•AFF87•3m ago•0 comments

Improved the social and emotional system – larkos(neural web)

1•Okerew•6m ago•0 comments

Why Ambiverts Make the Best Leaders

https://www.truity.com/blog/why-ambiverts-make-best-leaders
1•rbanffy•8m ago•0 comments

Linux 7.1 Expected to Begin Removing I486 CPU Suppor

https://www.phoronix.com/news/Linux-7.1-Phasing-Out-i486
2•mariuz•10m ago•0 comments

What if AI just makes us work harder?

https://timharford.com/2026/04/what-if-ai-just-makes-us-work-harder/
5•penguin_booze•15m ago•1 comments

Python: Profiling-Explorer

https://adamj.eu/tech/2026/04/03/python-introducing-profiling-explorer/
1•elashri•15m ago•0 comments

Go 1.25 and 1.26 Compiler Magic – How the Stack Is Eating the Heap

https://programmerscareer.com/go-stack-allocation-optimizations/
3•swq115•16m ago•0 comments

Lichess and Take Take Take Sign Cooperation Agreement

https://lichess.org/@/Lichess/blog/lichess-and-take-take-take-sign-cooperation-agreement/DZS0S0Dy
1•dematz•17m ago•0 comments

Why RAG doesn't work for WhatsApp AI agents and what's the alternative

https://wpp.opero.so/blog/why-rag-fails-for-whatsapp-and-what-we-built-instead
1•juancruzguillen•19m ago•1 comments

Satellite mirror plans could disrupt sleep and ecosystems, scientists say

https://www.theguardian.com/science/2026/apr/05/satellite-mirror-plans-could-disrupt-sleep-and-ec...
1•giuliomagnifico•21m ago•0 comments

Tiny Corp's Exabox

https://twitter.com/__tinygrad__/status/2040944508402360592
1•macleginn•21m ago•0 comments

Upwork Inc. violates its own DMARC and SPF policy

1•tmcdos•22m ago•0 comments

Ice-Out: Retiring IceLen until winter late 2026

https://www.bassfinity.com/blog/ice-out-2026-icelens-seasonal-close
1•jequals5•27m ago•0 comments

SQLite on Git, Part II: Unlocking Zlib's Less Known Feature

https://blog.lysk.tech/sqlite-on-git-part-2/
1•mlysk•27m ago•1 comments

Why Taking over Utilities Won't Deliver Cheap Electricity

https://oilprice.com/Energy/Energy-General/Why-Taking-Over-Utilities-Wont-Deliver-Cheap-Electrici...
1•PaulHoule•28m ago•0 comments

Ansel: Color Controls Finally Correct

https://ansel.photos/en/news/color-controls-finally-correct/
1•aurelienpierre•28m ago•0 comments

Practical LLM developer project management: Obsidian Kanban plan MD files in Git

https://savolai.net/notes/edu-tech-blog/llm-text-files-obsidian-kanban-practical-project-manageme...
1•savolai•32m ago•0 comments

Show HN: I built an app for comparing grocery prices across UK supermarkets

https://play.google.com/store/apps/details?id=com.wistfulcreations.GroceryCompare&hl=en_GB
1•poppet1208•33m ago•0 comments

Perplexity's "Incognito Mode" is a "sham," lawsuit says

https://arstechnica.com/tech-policy/2026/04/perplexitys-incognito-mode-is-a-sham-lawsuit-says/
2•JumpCrisscross•36m ago•0 comments

A New Linux Kernel Driver Wants to Catch Malicious USB Devices in the Act

https://itsfoss.com/news/linux-driver-proposal-malicious-hid-devices/
1•nobody9999•37m ago•0 comments

Ask HN: SoTA of Context Building Methods

2•h4ch1•37m ago•0 comments

The Intelligence Failure in Iran

https://www.theatlantic.com/national-security/2026/04/iran-war-intelligence-failure-trump/686694/
5•JumpCrisscross•39m ago•0 comments

Social media is populist and polarising; AI may be the opposite

https://www.ft.com/content/3880176e-d3ac-4311-9052-fdfeaed56a0e
2•Anon84•39m ago•0 comments

Show HN: Lilith-zero: Ultra-fast, Rust-based security middleware for MCP

https://github.com/BadC-mpany/lilith-zero
2•gregojaca•45m ago•1 comments

Social media has become a freak show

https://www.natesilver.net/p/social-media-has-become-a-freak-show
1•canarymark•49m ago•0 comments

Show HN: I replaced Google Analytics with my own tool – no cookies, <1KB script

https://datakool.com/
1•VictorChanet•50m ago•0 comments

When security matters: working with Qubes OS at the Guardian (2024)

https://theguardian.engineering/blog/info-2024-apr-04-when-security-matters-working-with-qubes-os...
1•Tomte•51m ago•0 comments

VOA's Legal Fight for Independence

https://www.cjr.org/analysis/voas-legal-fight-for-independence.php
1•Tomte•52m ago•0 comments