bytecodealliance / WASI-Virt

Virtual implementations of WASI APIs
Apache License 2.0
131 stars 16 forks source link

Reversed WASI interfaces? #57

Open ZheniaZuser opened 4 months ago

ZheniaZuser commented 4 months ago

I have the use case about which I am not sure if currently possible/handled: Virtual File system consumed by host. For example: virtual disk file on host's FS > wasm component that reads it through wasi-fs and gives read\write access to it's encapsulated FS through wasi-fs interface that is exposed to host > and is consumed by "wasi-fs to WinFSP adapter" giving access to the FS to all Windows software (and similarly "wasi-fs to FUSE adapter" on Linux).

guybedford commented 4 months ago

Component binaries need to at the root reference host-supported WIT. So if you wanted to output a component that binds to WinFSP, the first step would be to create a host implementation of these bindings for the component model, defined in a WIT package.

Given such a host interface and implementation, creating an FS adapter to this implementation can be achieved very similarly to how WASI-Virt works, but it would likely be more like a fork of WASI-Virt to achieve the use case given the specific nature of the target bindings.