Stream: git-wasmtime

Topic: wasmtime / issue #8101 Inconsistency between main Wasmtim...


view this post on Zulip Wasmtime GitHub notifications bot (Mar 12 2024 at 17:10):

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).

view this post on Zulip Wasmtime GitHub notifications bot (Mar 12 2024 at 18:27):

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?

view this post on Zulip Wasmtime GitHub notifications bot (Mar 12 2024 at 22:42):

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.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 13 2024 at 14:20):

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).

view this post on Zulip Wasmtime GitHub notifications bot (Mar 13 2024 at 16:47):

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?

view this post on Zulip Wasmtime GitHub notifications bot (Mar 13 2024 at 18:30):

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: Oct 23 2024 at 20:03 UTC