Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expose run_wasm host function to wasm #3420

Closed
pannous opened this issue Dec 12, 2022 · 6 comments
Closed

expose run_wasm host function to wasm #3420

pannous opened this issue Dec 12, 2022 · 6 comments
Assignees
Labels
🎉 enhancement New feature! ⚙️ feature request lib-wasix Issues related to the WASIX toolchain. priority-medium Medium priority issue 🏚 stale Inactive issues or PR

Comments

@pannous
Copy link

pannous commented Dec 12, 2022

There is an interesting suggestion for WASI to add an
API to instantiate a module from wasm bytes: WebAssembly/WASI#477

Since wasmer is often ahead of the curve, would you consider exposing a private experimental function
run_wasm(buffer, length) which allows for modules to dynamically run (tiny) other modules, within the same security context?

Use cases would be plugins for wasm programs, compilers running inside wasm etc…

The c function header might look like this:

__attribute__((import_module("wasi_private"), import_name("run_wasm")))  
extern long run_wasm(uint8* buffer, size_t buffer_length)
@pannous pannous added the 🎉 enhancement New feature! label Dec 12, 2022
@ptitSeb
Copy link
Contributor

ptitSeb commented Dec 13, 2022

@theduke would this be part of WASIX?

@theduke
Copy link
Contributor

theduke commented Dec 14, 2022

WASIX already supports spawning threads and even processes.

Allowing to spawn with just a raw Wasm module is the logical next step.
We definitely want that in WASIX.

Of course if it makes it into WASI we will also want to add support there.

@pannous
Copy link
Author

pannous commented Dec 14, 2022

Thanks, we will use https://docs.rs/wasix/latest/wasix/fn.proc_spawn.html as intermediate solution!

{ saving binary and then call proc_spawn("wasmer",0,"funclet.wasm" … ) or something. }

@theduke
Copy link
Contributor

theduke commented Dec 15, 2022

Note that this will not work with a .wasm file at the moment!

That is something that needs to be implemented.

Copy link

stale bot commented Dec 21, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the 🏚 stale Inactive issues or PR label Dec 21, 2023
Copy link

stale bot commented Jan 20, 2024

Feel free to reopen the issue if it has been closed by mistake.

@stale stale bot closed this as completed Jan 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎉 enhancement New feature! ⚙️ feature request lib-wasix Issues related to the WASIX toolchain. priority-medium Medium priority issue 🏚 stale Inactive issues or PR
Projects
None yet
Development

No branches or pull requests

4 participants