Readit News logoReadit News
qwertycodepl commented on Show HN: Astra – a new js2exe compiler   github.com/astracompiler/... · Posted by u/qwertycodepl
xhbxbsbebs · 7 months 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 commented on Show HN: Astra – a new js2exe compiler   github.com/astracompiler/... · Posted by u/qwertycodepl
belmarca · 7 months 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 commented on Show HN: Astra – a new js2exe compiler   github.com/astracompiler/... · Posted by u/qwertycodepl
dpcan · 7 months 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 · 7 months ago
Yes, astra it's aiming to compile CLIs and servers (express, fastify etc.). It's not replacing electron.
qwertycodepl commented on Show HN: Astra – a new js2exe compiler   github.com/astracompiler/... · Posted by u/qwertycodepl
quotemstr · 7 months 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 · 7 months 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.

qwertycodepl commented on Show HN: Astra – a new js2exe compiler   github.com/astracompiler/... · Posted by u/qwertycodepl
zamadatix · 7 months 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 · 7 months 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.

qwertycodepl commented on Show HN: Astra – a new js2exe compiler   github.com/astracompiler/... · Posted by u/qwertycodepl
ymsodev · 7 months ago
Honestly, I would drop calling compiler altogether -- it's just not a compiler. It doesn't make it any less cool though!
qwertycodepl · 7 months 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!
qwertycodepl commented on Show HN: Astra – a new js2exe compiler   github.com/astracompiler/... · Posted by u/qwertycodepl
Vorh · 7 months 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 · 7 months 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!
qwertycodepl commented on Show HN: Astra – a new js2exe compiler   github.com/astracompiler/... · Posted by u/qwertycodepl
belmarca · 7 months 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 · 7 months 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!

qwertycodepl commented on Show HN: Astra – a new js2exe compiler   github.com/astracompiler/... · Posted by u/qwertycodepl
TheRealPomax · 7 months 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 · 7 months ago
thanks :)
qwertycodepl commented on Show HN: Astra – a new js2exe compiler   github.com/astracompiler/... · Posted by u/qwertycodepl
jasonjmcghee · 7 months 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 · 7 months ago
yes but it uses node SEA you can read about it here: https://nodejs.org/api/single-executable-applications.html

u/qwertycodepl

KarmaCake day19May 20, 2025View Original