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

Re-Implement resumable functions in wasmi #537

Closed
Robbepop opened this issue Oct 24, 2022 · 4 comments · Fixed by #598
Closed

Re-Implement resumable functions in wasmi #537

Robbepop opened this issue Oct 24, 2022 · 4 comments · Fixed by #598
Labels
enhancement New feature or request

Comments

@Robbepop
Copy link
Member

Robbepop commented Oct 24, 2022

@tomaka provided us with a compelling argument for supporting resumable functions in wasmi again: #536

We removed the resumable functions feature in wasmi version 0.14 which also is the release in which we moved from the so-called legacy wasmi engine to the new reimplemented wasmi engine.
For simplicity and also because we were not aware of any important use cases back then we removed support for resumable functions. However, even though the new wasmi engine works quite differently and has a substantially different interface we are confident that resumable functions can be re-implemented for it.

This issue tracks progress and accumulates design ideas, issues and rationals.

edit: legacy wasmi API for resumable functions: https://docs.rs/wasmi/0.13.2/wasmi/struct.FuncInvocation.html

@tomaka
Copy link
Contributor

tomaka commented Oct 24, 2022

Small note:

Wasmtime also doesn't provide a "resumable functions-like" API. In order to work around this in smoldot, I've implemented a "resumable functions-like" API on top of it. However, this comes at a pretty significant performance cost and is only possible because wasmtime allows you to bind asynchronous functions.
So this issue kind of relates in a way to a feature that lets you bind asynchronous functions.

However, to be clear, to me the superior API is the "resumable functions" one. Any other API can be implemented on top of it with (in theory) a negligible performance cost.

@Robbepop Robbepop added enhancement New feature or request wasmi-v1 and removed wasmi-v1 labels Oct 25, 2022
@Robbepop

This comment was marked as outdated.

@Robbepop

This comment was marked as outdated.

@Robbepop Robbepop mentioned this issue Dec 31, 2022
3 tasks
@Robbepop
Copy link
Member Author

Robbepop commented Jan 1, 2023

The design in #598 is as follows:

impl Func
docs-1

enum ResumableCall
docs-2

struct ResumableInvocation
docs-screenshot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants