Stream: general

Topic: ✔ Wasm module building best practices


view this post on Zulip kellytk (Oct 26 2023 at 23:58):

I've followed the example at https://github.com/bytecodealliance/wasmtime#example and read the wasmtime book. To confirm, is running rustc directly (rustc hello.rs --target wasm32-wasi) the currently preferred method of building a .wasm module to run with wasmtime? vs say, some usage of Cargo.toml and cargo build

A fast and secure runtime for WebAssembly. Contribute to bytecodealliance/wasmtime development by creating an account on GitHub.

view this post on Zulip kellytk (Oct 27 2023 at 00:19):

There is also https://github.com/bytecodealliance/cargo-wasi which appears potentially related. I didn't find it mentioned in the wasmtime book

A lightweight Cargo subcommand to build Rust code for the `wasm32-wasi` target - GitHub - bytecodealliance/cargo-wasi: A lightweight Cargo subcommand to build Rust code for the `wasm32-wasi` target

view this post on Zulip kellytk (Oct 27 2023 at 03:34):

After perusing the options, I'll use cargo build --target=wasm32-wasi to remain closer to the fundamentals for now, and consider using cargo-wasi in the future

view this post on Zulip Notification Bot (Oct 27 2023 at 03:35):

kellytk has marked this topic as resolved.


Last updated: Dec 23 2024 at 13:07 UTC