Replies: 0 comments 8 replies
-
WebAssembly would probably be best suited for a subset of Node.js features - not everything Node.js can do in an OS context is possible in wasm, and having a lightweight module is typically preferable. Looking forward to the discussion! |
Beta Was this translation helpful? Give feedback.
-
@krpeacock I think you could already do this. You can write a script that loads/runs WebAssembly and inject that using SEA. See https://nodejs.org/api/wasi.html |
Beta Was this translation helpful? Give feedback.
-
@krpeacock I think adding a wasm/wasi build target for Node.js would be a major endeavor. We know it's kind of possible given that the private fork of Node.js in StackBlitz/WebContainer is doing just that, however, we'd need somebody to lead this effort. |
Beta Was this translation helpful? Give feedback.
-
The major work of ML revolves around rattling the database/microservices constantly and compiling the functions which do this in WASM will not help it whatsoever. The surprising part you didn't mention is wasm code cannot be codesplit/chunked because there is no such thing as dynamic import in wasm. And that means a potential wasm-ready SEA must be written in a very specific way incompatible with the way javascript programs are written. This can be a major issue for anyone working towards implementing it, since they will have to basically develop a javascript dialect, eat up all the problems caused by inventing another dialect and maintain it long-term. |
Beta Was this translation helpful? Give feedback.
-
Hello maintainers,
I hope you are doing well. I would like to propose adding support for WebAssembly / Wasmtime as a build target in Node.js as an extension of the new single executable applications feature.
As you may know, WebAssembly is a binary format that enables us to run code written in multiple programming languages, including C++, Rust, and Go, in a cross-platform environment. It provides an efficient, secure, and portable way to run code across different platforms.
By adding support for WebAssembly / Wasmtime as a build target, Node.js devs could leverage its benefits to open up new cross-platform opportunities. Here are a few of the advantages:
I believe adding support for WebAssembly / Wasmtime as a build target would be an interesting step forward for Node.js and WebAssembly, and I hope you consider it for future releases.
Thank you for your attention, and please let me know if you have any questions or concerns.
Sincerely,
Kyle
Beta Was this translation helpful? Give feedback.
All reactions