3 ms·
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 mod
by ijustlovemath 3y 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 https://github.com/ijustlovemath/jescx
- dns_snek 3y agoIsn't QuickJS order(s) of magnitude slower than V8? That doesn't seem like a practical tradeoff to make outside of embedded.
- ijustlovemath 3y agoLike 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.
- factormeta 3y agoThanks for sharing that info! Would like to see more runtime independent JS project such Hono. Although I'm not sure if it supports QuickJS.
- tracker1 3y agoDepends on what you are doing and what your needs are .. the gp comment was about the size.