Announcement: I have a POC for a new tool called wepl (The WebAssembly REPL).
This tool allows you to interact with WebAssembly components in a continuous and dynamic way. The following features are currently supported:
- Evaluate exported functions
- Listing the imports and exports
- "Dynamic linking" (i.e., specifying that another WebAssembly component's export should be used to satisfy your component's import)
- Basic component composition (e.g., you can compose WASI-Virt with your component)
- Variable assignment (i.e., you can use the output of one export as input to another)
- Basic type checking for somewhat decent error messages.
Here's what a session might look like:
$ wepl mycomponent.wasm
> .exports
uppercase_and_suffix: func(input: string) -> string
> uppercase_and_suffix
uppercase_and_suffix: func(input: string) -> string
> s = "hello"
s: string
> .link suffix my_suffixer.wasm
> uppercase_and_suffix(s)
"HELLO!!"
Some future features would likely include:
- Full support for the composition language that @Brian and @Peter Huene have been working on
- More ways to do "dynamic linking" - (e.g., perhaps being able to satisfy an import with a Python script)
- More inspection and metadata capabilities (i.e., be the interactive front-end for much wasm-tools functionality)
- Saving composed components back to disk
I think this could be really useful, but I'm not sure what others will think, so feedback is very much appreciated.
A repl for WebAssembly Components. Contribute to rylev/wepl development by creating an account on GitHub.
Last updated: Dec 23 2024 at 12:05 UTC