Stream: wasmtime

Topic: Different Linker types


view this post on Zulip Lorenzo (Nov 17 2024 at 23:58):

What is the difference between wasmtime::Linker and wasmtime::component::Linker?

wasmtime_wasi::preview1::add_to_linker_async expects a wasmtime::Linker, but wasmtime_wasi_http::add_only_http_to_linker_async expects a wasmtime::component::Linker. I'm not sure how to make these work together?

view this post on Zulip bjorn3 (Nov 18 2024 at 09:06):

wasmtime::Linker is for core wasm modules, while wasmtime::component::Linker is for wasm components.

view this post on Zulip bjorn3 (Nov 18 2024 at 09:07):

wasip1 uses core wasm, while wasi-http is part of wasip2 which uses wasm components.

view this post on Zulip bjorn3 (Nov 18 2024 at 09:08):

If you want to use wasi-http you will have to build your wasm module for wasip2 and use wasmtime_wasi::add_to_linker_async with a wasmtime::component::Linker.

view this post on Zulip Victor Adossi (Nov 21 2024 at 17:51):

For resources on what components are and what the component model is:

Component Model Book
CM explainer (other good docs in there -- repo root is worth looking at!)
WebAssembly Interface Types ("WIT")

Repository for design and specification of the Component Model - WebAssembly/component-model
Repository for design and specification of the Component Model - WebAssembly/component-model
Repository for design and specification of the Component Model - WebAssembly/component-model

view this post on Zulip Lorenzo (Nov 24 2024 at 03:35):

Makes sense, thank you! Appreciate the resources @Victor Adossi


Last updated: Dec 23 2024 at 14:03 UTC