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}}]}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章