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!
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!
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!
We're probably going to have to live with "compiler" meaning "bundler" as an ongoing JavaScript-world neologism.
- 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.
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)
I'm just asking since a 512gb disk has become the standard when ordering a laptop.
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.
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.
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?
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.
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.)
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.
jasonjmcghee•3h ago
qwertycodepl•3h ago