I've recently been working on a experimental version of componentize-js backed by the quickjs runtime. The goal of the project is to produce tiny components with an embedded JS runtime. With size optimizations enabled, the hello world component comes in at roughly 750KB. It supports wizer and wasi stubbing. Maybe someone will find this useful.
thanks @Joel Dice for all the help.
https://github.com/andreiltd/componentize-qjs
@Saúl Cabrera :-)
An update on this: the components produced by componentize-qjs now supports p3 semantics: async/futures/streams.
I don't know how practical it would be, but it would be great if we could combine the SpiderMonkey-backed and QuickJS-backed projects and let the user pick a runtime via e.g. a CLI option, ideally with no code changes on their side, assuming they stay within the subset of features that both runtimes provide.
I think it makes a lot of sense! I could give it a try (move quickjs runtime into your project) and see what are the blockers. Off the top of my head, I think I relied on slightly different linking model to keep the binary size small: instead of providing dynamic libc.so to the component linker, I linked libc statically into runtime. The result is that linker will dce a lot from libc (around 1M IIUC).
Makes sense. I don't think we'll do that with SpiderMonkey since we plan on using dynamic linking to provide optional native extensions, but it makes sense for minimizing binary size for QuickJS.
Yeah, I see the tiny size as a main selling point of qjs runtime, but I think if we sprinkle enough "ifs" we can do both dynamic and static linking :)
Do you plan to allow selectively enable compatibility layers, like for example if I only need a console I can do --compat consle and it will add the console extension to the linker? Is that what you mean by optional extensions?
@Till Schneidereit can probably say more about how he wants to use dynamic linking in StarlingMonkey, but yes, I think you have the right idea. For example, if you wanted to use an extension that implements Node.js's fs module, that would be packaged as a .so file, but not necessarily linked in by default.
Last updated: Mar 23 2026 at 18:16 UTC