rikhuijzer opened issue #8101:
I've been reading a bit about the Bytecode Alliance and Wasmtime and I am currently somewhat confused.
My confusion comes from the fact that I started learning about Wasmtime from https://wasmtime.dev. This example is positioned clearly on the front page:
fn main() { println!("Hello, world!"); }
$ rustup target add wasm32-wasi $ rustc hello.rs --target wasm32-wasi $ wasmtime hello.wasm Hello, world!
So from that my main take away was that Wasmtime can be used to run Rust code in a secure sandbox.
However, when I actually go into the codebase and the docs at https://docs.wasmtime.dev/, then the example from the front page isn't even mentioned, but instead it is mostly about how to use the Wasmtime API (not CLI) to run programs which now suddenly require
wat
files too.So my question is: how should I mentally connect these two concepts? Why did the first example not require a
wat
file while the Hello, world! example does?If someone could provide me some quick and high level overview, then I'll do my best to update the documentation based on that (with the caveat that I'm AFK the next week and the week after).
abrown commented on issue #8101:
*.wasm
and*.wat
files are equivalent:*.wasm
is the binary encoding while*.wat
is the (somewhat) human-readable textual representation. Does that help?
alexcrichton commented on issue #8101:
If you're up for it, assistance in updating documentation is always appreciated! We've got a number of ways that Wasmtime can be used and it's hard to keep them all updated and in-sync and generalized for any target audience.
fitzgen closed issue #8101:
I've been reading a bit about the Bytecode Alliance and Wasmtime and I am currently somewhat confused.
My confusion comes from the fact that I started learning about Wasmtime from https://wasmtime.dev. This example is positioned clearly on the front page:
fn main() { println!("Hello, world!"); }
$ rustup target add wasm32-wasi $ rustc hello.rs --target wasm32-wasi $ wasmtime hello.wasm Hello, world!
So from that my main take away was that Wasmtime can be used to run Rust code in a secure sandbox.
However, when I actually go into the codebase and the docs at https://docs.wasmtime.dev/, then the example from the front page isn't even mentioned, but instead it is mostly about how to use the Wasmtime API (not CLI) to run programs which now suddenly require
wat
files too.So my question is: how should I mentally connect these two concepts? Why did the first example not require a
wat
file while the Hello, world! example does?If someone could provide me some quick and high level overview, then I'll do my best to update the documentation based on that (with the caveat that I'm AFK the next week and the week after).
rikhuijzer commented on issue #8101:
If you're up for it, assistance in updating documentation is always appreciated! We've got a number of ways that Wasmtime can be used and it's hard to keep them all updated and in-sync and generalized for any target audience.
@alexcrichton good to know! When updating the docs, is it important to try to not conflict with https://github.com/bytecodealliance/wasmtime/pull/7987?
alexcrichton commented on issue #8101:
Oh no don't worry about that, I need to spend time on that at some point but I haven't gotten to it. Feel free to change whatever you'd like and I'm happy to work around any merge conflicts.
Last updated: Dec 23 2024 at 12:05 UTC