Bytecode Alliance宣布服务器端WebAssembly发展愿景

{"type":"doc","content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"在"},{"type":"link","attrs":{"href":"https:\/\/bytecodealliance.org\/","title":null,"type":null},"content":[{"type":"text","text":"Bytecode Alliance"}]},{"type":"text","text":"成立一周年之际,WebAssembly开发者Lin Clark和Till Schneidereit在博客中宣布,Fastly已经从Mozilla手中收购了部分WebAssembly团队。在未来,Mozilla将继续关注浏览器中的WASM,尤其是Firefox浏览器。另一方面,Fastly将管理服务器端的WASM,包括Fastly自己的商业WebAssembly服务器产品Compute@Edge。这也导致了Mozilla的wasmtime和Fastly Lucet Wasm VM项目的合并。Lucet和wasmtime共享了很多代码,这次合并确保了它们未来的开发将继续沿着同样的方向进行。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"在博文中,Clark和Schneidereit描绘了他们对服务器端WASM未来的技术愿景。他们的核心观点是nanoprocess模型,它为WASM程序提供了一个安全且轻量级的容器,但仍然可以让沙箱内的WASM程序很容易与其他WASM程序及系统的其他部分通信。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"从技术上讲,WASM在通往"},{"type":"link","attrs":{"href":"https:\/\/hacks.mozilla.org\/2019\/11\/announcing-the-bytecode-alliance\/","title":null,"type":null},"content":[{"type":"text","text":"nanoprocess"}]},{"type":"text","text":"的关键路径上有三个增强提议。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"第一个增强是WebAssembly Systems Interface(WASI),它为WASM程序提供了一种调用宿主系统标准库函数的方法。在服务器端,也就是指访问文件系统、环境变量、随机数和套接字。现在,多个领先的WASM实现都支持WASI。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"WASI的实现在完整性和性能方面各不相同。例如,谷歌的V8使用主机环境的JavaScript运行时作为访问操作系统的代理,因此速度很慢。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"WASI方法并不仅限于访问操作系统标准库。这篇博文还讨论了Bytecode Alliance倡导的其他类似WASI的扩展,比如"},{"type":"link","attrs":{"href":"https:\/\/github.com\/WebAssembly\/WASI\/pull\/312","title":null,"type":null},"content":[{"type":"text","text":"wasi-socket"}]},{"type":"text","text":"和"},{"type":"link","attrs":{"href":"https:\/\/github.com\/WebAssembly\/wasi-nn","title":null,"type":null},"content":[{"type":"text","text":"wasi-nn"}]},{"type":"text","text":"。除了Bytecode Alliance之外,还有很多项目可以让WASM访问更多的主机功能。例如,在区块链领域,以太坊WebAssembly ("},{"type":"link","attrs":{"href":"https:\/\/ewasm.readthedocs.io\/en\/mkdocs\/","title":null,"type":null},"content":[{"type":"text","text":"Ewasm"}]},{"type":"text","text":")也是WASI的一种形式,它可以让WASM访问主机以太坊区块链的用户帐户和交易服务。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"第二个增强是接口类型,它可以让WASM程序与外部程序通信,无论是在主机操作系统中,还是内嵌了WASM的语言运行时(例如,Node.js)中。这个建议还处于早期阶段,还没有得到编译器工具链的支持。但是,"},{"type":"link","attrs":{"href":"https:\/\/fitzgeraldnick.com\/2020\/08\/27\/reference-types-in-wasmtime.html","title":null,"type":null},"content":[{"type":"text","text":"wasmtime"}]},{"type":"text","text":"和"},{"type":"link","attrs":{"href":"https:\/\/blog.secondstate.io\/post\/20201026-toward-a-more-interoperable-webassembly\/","title":null,"type":null},"content":[{"type":"text","text":"Second State VM"}]},{"type":"text","text":"已经支持它。目标是让WASM程序更强大和具备更强的嵌入能力。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"综合起来,WASI和接口类型让开发人员可以充分利用原生主机系统,同时保持WASM沙箱的安全性。早期的一个例子是Second State VM为其WASM程序提供原生GPU访问能力来进行tensorflow模型推断。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"nanoprocess的第三个元素是模块链接,除了让WASM程序可以调用主机函数外,还可以相互调用。声明模块依赖关系的能力可以支持类似Node.js NPM和Rust "},{"type":"link","attrs":{"href":"http:\/\/crate.io\/","title":null,"type":null},"content":[{"type":"text","text":"Crate.io"}]},{"type":"text","text":"这样的公共包管理系统,为已经启动的"},{"type":"link","attrs":{"href":"https:\/\/wapm.io\/","title":null,"type":null},"content":[{"type":"text","text":"WAPM"}]},{"type":"text","text":"工作提供补充。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"这篇博文参引用了Bytecode Alliance为服务器端的WASM设计的愿景。与此同时,WASM开源社区现在比Bytecode Alliance要大得多。现在有多种WASM虚拟机实现、编程语言的编译器工具链以及主机操作系统和环境(例如,"},{"type":"link","attrs":{"href":"https:\/\/www.secondstate.io\/articles\/getting-started-with-rust-function\/","title":null,"type":null},"content":[{"type":"text","text":"Node.js"}]},{"type":"text","text":"、"},{"type":"link","attrs":{"href":"https:\/\/www.infoq.com\/articles\/deno-loves-webassembly\/","title":null,"type":null},"content":[{"type":"text","text":"Deno"}]},{"type":"text","text":"或"},{"type":"link","attrs":{"href":"https:\/\/blog.secondstate.io\/post\/20200302-polkadot-en\/","title":null,"type":null},"content":[{"type":"text","text":"区块链"}]},{"type":"text","text":")。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"原文链接"},{"type":"text","text":":"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"link","attrs":{"href":"https:\/\/www.infoq.com\/news\/2020\/10\/bytecode-alliance-one-year\/","title":null,"type":null},"content":[{"type":"text","text":"Bytecode Alliance Lays out Plans for WebAssembly on the Server-side"}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}}]}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章