Stream: wasmtime

Topic: ✔ Parsing type info from .wasm component binary


view this post on Zulip Anatolii Smolianinov (Dec 17 2024 at 15:49):

hi, I was thinking about having a repository of wasm+component programs which are used by my custom wasm runtime. I want to be able to analyze types which are expected and exposed by .wasm+component binary in order to e.g. reject a submitted program which doesn't comply a certain interface.

Or, for example, if I have a bunch of wasm+component programs in my programs repository with various in/out types, I want to expose them in order to connect inputs and outputs manually, or, generate some inputs. Is there any kind of libraries or built-in functionality related to such use cases? thanks!

view this post on Zulip fitzgen (he/him) (Dec 17 2024 at 15:54):

the wasmparser crate can parse and validate a component and its types. it is part of the wasm-tools repo: https://github.com/bytecodealliance/wasm-tools

CLI and Rust libraries for low-level manipulation of WebAssembly modules - GitHub - bytecodealliance/wasm-tools: CLI and Rust libraries for low-level manipulation of WebAssembly modules

view this post on Zulip Anatolii Smolianinov (Dec 17 2024 at 15:58):

thanks, I will try to expand the example! https://github.com/bytecodealliance/wasm-tools/blob/9d3016071952148f1b997ee4e40140e9cd9baa36/crates/wasmparser/examples/simple.rs

CLI and Rust libraries for low-level manipulation of WebAssembly modules - bytecodealliance/wasm-tools

view this post on Zulip Notification Bot (Dec 17 2024 at 15:58):

Anatolii Smolianinov has marked this topic as resolved.


Last updated: Dec 23 2024 at 14:03 UTC