I'm trying to figure out how to connect the various pieces here. I'm working on an experimental programming language project that will integrate with WASM components. The idea is that I want people to be able to just write something like use wasi:cli/command
and then seamlessly work with it.
To make this work I need to be able to go from a user-provided name like wasi:io/error/error
to the definition it refers to, fetching any required dependencies etc along the way. I will have many such names to process in rather unreliable orders so I'd like to cache things. Basically the API I want to end up with is like
struct ComponentDependencies {}
impl ComponentDependencies {
pub fn get(&mut self, package: &str, path: &str) -> Result<Definition>
}
As best I can tell the workflow should be something like
CachingClient
from wasm-pkg-client
and invoke get_content
; save this into a file. This will be an encoded wasm content.wit-parser::Resolve
and push the path to that file.Some questions:
I believe this is intended to be what you're looking for but I'm not sure exactly what state it is in right now: https://docs.rs/wasm-pkg-core/0.8.5/wasm_pkg_core/resolver/struct.DependencyResolver.html
Last updated: Dec 23 2024 at 12:05 UTC