Hacker News new | ask | show | jobs
by ijustlovemath 871 days ago
I'm not sure what your requirements are, but I've had a good amount of success with converting Node.js libraries to native libraries by embedding a CommonJS module into the binary, then running the actual code through QuickJS. Much smaller binaries.

If you really are pressed for space, you could use upx, or store 7z compressed code and embed the 7z library to decompress before passing it along to QuickJS.

Here's a proof of concept: https://github.com/ijustlovemath/jescx

1 comments

Isn't QuickJS order(s) of magnitude slower than V8? That doesn't seem like a practical tradeoff to make outside of embedded.
Like I said, I wasn't sure of their requirements. I can say QuickJS is orders of magnitude easier to embed and understand than V8, which is why I adopted it for my use case.
Thanks for sharing that info!

Would like to see more runtime independent JS project such Hono. Although I'm not sure if it supports QuickJS.

Depends on what you are doing and what your needs are .. the gp comment was about the size.