-
Notifications
You must be signed in to change notification settings - Fork 257
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
Create InstantiatedModule type #170
Comments
If we do this I also think we should think hard about whether adding and replacing functions on an instantiated module is something to support or not. Safety-wise it feels we shouldn't keep doing this, rather allow someone to change the imports/exports etc only up to |
from @mathetake
|
this is done via |
There's a lifecycle requirement that is tricky to prove here:
https://www.w3.org/TR/wasm-core-1/#start-function%E2%91%A0
Right now,
Store
includes the instantiated module state internally.Due to this, to satisfy the above things, runtime checks like this have to happen internally.
This are subject to racing which makes them hard to test also. Finally, it burdens the user a little as they have a way to invoke something when it can be in the wrong state. Ex.
I think a cleaner design would be to make an InstantiatedModule type and move features that require start being invoked first, to be on that type. That features are only on the correct type, people wouldn't be tempted to do something at the wrong time or when something isn't available
Ex.
The text was updated successfully, but these errors were encountered: