Stream: wasmtime

Topic: wasi-libc for Language Backend


view this post on Zulip Ashanti Mutinta (Oct 22 2024 at 14:37):

I was thinking about wasi-libc and was wondering if you would recommend it for a language backend interested in wasm compilation? Are there any limitations to using it? Say for example I wanted to provide socket support for a scripting language.

view this post on Zulip Victor Adossi (Oct 24 2024 at 14:49):

There are much better people who can/will answer, but I do want to point you to componetize-py which is written using wasi-libc (a fork, for now) and might be worth taking a look at if you haven't yet!

Contribute to bytecodealliance/componentize-py development by creating an account on GitHub.

view this post on Zulip Joel Dice (Oct 24 2024 at 15:29):

.NET, Rust, and LLVM/Clang also use wasi-libc when targeting WASI. Note that you don't need to use wasi-libc to target WASI -- it's just convenient if you already target a POSIX-like environment. Alternatively, you could target WASI directly without any kind of POSIX emulation; I believe that's what Go does.

view this post on Zulip Joel Dice (Oct 24 2024 at 15:31):

BTW, componentize-py only uses a fork of wasi-libc because Rust didn't have native wasm32-wasip2 support until recently. I've just opened an issue to switch to upstream.

Now that Rust supports the wasm32-wasip2 target, we should be able to stop using my fork of WASI-SDK and instead use the latest upstream release. Also, IIRC, Rust builds with -fPIC by default for w...

view this post on Zulip Ashanti Mutinta (Oct 31 2024 at 11:52):

Joel Dice said:

.NET, Rust, and LLVM/Clang also use wasi-libc when targeting WASI. Note that you don't need to use wasi-libc to target WASI -- it's just convenient if you already target a POSIX-like environment. Alternatively, you could target WASI directly without any kind of POSIX emulation; I believe that's what Go does.

Awesome thank you!


Last updated: Nov 22 2024 at 17:03 UTC