This folder contains examples that can be run with wasmcloud which are written in Rust.
As much of WebAssembly tooling is written in Rust, Rust currently possesses the best support for WebAssembly and it's emerging standards.
Example components built in Rust can be compiled similarly to any other wasmcloud project:
wash build
As WebAssembly is intended to be a "compilation target" for native Rust code, upstream work is underway to integrate and improve support for the various standards of WebAssembly.
Language | Core Modules (wasm32-unknown-unknown ) |
Preview 1 (wasm32-wasi-preview1 ) |
WASIP2 (wasm32-wasip2 ) |
---|---|---|---|
Rust | ✅ (--target=wasm32-unknown-unknown ) |
✅ (--target=wasm32-wasip1 ) |
✅ (--target=wasm32-wasip2 ) |
[!NOTE] Don't know what
wasm32-unknown-unknown
means versuswasm32-wasi-preview1
?
wasm32-unknown-unknown
is a compile target which deals in core WebAssembly modules (i.e. you're only given access to numbers at this level)wasm32-wasip1
is a compile target that provides richer types, support for more higher level platform APIswasm32-wasip2
is the next generation compile target with much richer types, higher level APIs like async, streaming, the WIT IDL.In a sentence, WebAssembly functionality is layered, with
wasm32-unknown-unknown
being the most basic (only doing operations on numbers) andwasm32-wasip2
being the current most advanced.
To learn more about how wasmCloud works, check out the wasmCloud documentation.
To learn more WebAssembly ecosystem language support, check out the SIG Guest Languages Zulip group.
Development on Rust support is stewarded by the Bytecode Alliance.
The Bytecode Alliance maintains a WebAssembly runtime called wasmtime
which is written in Rust, and is a great place to start learning about Rust support.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。