节点wasi vs产生儿童过程
WASI API提供了WebAssembly系统接口规范的实现。 WASI通过类似Posix的功能的集合使Sandboxed WebAssembly应用程序访问了基础操作系统。
我的问题是:
使用WASI API的最大好处是什么,例如,覆盖了其他一些儿童过程或运行非Nodejs代码的类似方法?
我必须假设它比产卵过程更快,或者由于本机API而使用一些带有绑定的C代码。
也许我只是误解了WASI背后的整个想法,因为这使WASM如此出色的部分是可以使用服务器端,完整的吹制编程语言(大部分)的能力,就像所有<所有< a href =“ https://esbuild.github.io/” rel =“ nofollow noreferrer”>疯狂的工具我们已经看到了go/rust。
这是为了在本机中运行wasm的好处,同样,与运行子过程相比,有什么好处?
In the NodeJS docs it states the following:
The WASI API provides an implementation of the WebAssembly System Interface specification. WASI gives sandboxed WebAssembly applications access to the underlying operating system via a collection of POSIX-like functions.
My question is:
What is the biggest benefit of using the WASI API over, say, spawing some other child process or similar methods of running non-nodejs code?
I would have to assume it's faster than spawning a child process, or using some C code with bindings due to the native-api.
Maybe I'm simply misunderstanding the entire idea behind WASI, which is plausable, given that part of what makes WASM so amazing is the ability to use a server-side, full blown programming language on the web (mostly), like all the crazy tools we've seen with Go/Rust.
Is this more so for the benefit of running WASM in node, natively, and again, if so, what are the benefits compared to running child processes?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
当前最大的好处是跨平台支持。您不需要为您支持的每个平台编译孩子流程;只需为WASM/WASI编译一次即可。
将来它也将变得更加安全,因为这样的过程是正确的。但是,显然Node尚未SandBox WASI文件系统访问。
速度是WASM/WASI的主要下行。它比本地慢2倍。
其他大弊端:
The biggest benefit currently is cross platform support. You don't need to compile your child process for every platform you support; just compile it once for WASM/WASI.
In future it will also be more secure because then the process is sandboxes properly. However apparently Node doesn't sandbox WASI filesystem access yet.
Speed is the main downside of WASM/WASI. It's about 2x slower than native.
Other big downsides:
我最终从这里删除的帖子得到了答案。
用真正高级的话来说,WASI只是WASM的(系统)接口。
我最终找到了
I ended up getting my answer from a post here that was removed.
In really high-level terms, WASI is simply an (systems) interface for WASM.
I ended up finding this short 'article', if you will, super helpful too!