-
Notifications
You must be signed in to change notification settings - Fork 25
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
RFC: shared host functions. #9
RFC: shared host functions. #9
Conversation
d69dd5c
to
b76813a
Compare
b76813a
to
6baa11a
Compare
This RFC proposes to extend the Wasmtime API to allow users to define host functions in a `Config` that can be shared between multiple engines and therefore stores. Today, `Func` is used to define host functions, but it is tied to a `Store`. If users desire short-lived stores to ensure short-lived instances, host functions need to be redefined upon every module instantiation. By defining host functions with a `Config`, instances can be created without having to redefine the host functions; this will make for faster module instantiations in scenarios where a module is repeatedly instantiated.
6baa11a
to
5ec4357
Compare
Engine
-level.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me!
On the WasiCtx
in particular, the way I now see this is that all of the things we currently store in WasiCtx
will eventually be moved out to be stored in other places. With the switch to handles and resources, we'll no longer need things like the entries
table inside WasiCtx
; we'll just have handles and resources.
Motion to finalize with a disposition to mergeI'm proposing that we merge this RFC. Feedback has been addressed from the draft RFC and an implementation in Wasmtime is ready for review. Stakeholders sign-offTagging all employees of BA-affiliated companies who have committed to the Wasmtime repo in the last three months plus anyone who has given feedback on this PR as a stakeholder. FastlyIBMIntelMozilla |
Preface: I'm new to the wasmtime codebase (but would love to get up to speed and start contributing in the future), and I might be completely offbase with this. Would it be possible to somehow turn this into the "import object bound" that makes |
The problem this RFC tries to address isn't really related to This RFC calls for defining host functions in a way that is not tied to a As Does that explanation make sense? |
That makes a lot of sense, thank you! I see how this solves much of the same use case. |
Entering Final Call Period
The FCP will end on Tue Mar 9. |
The FCP has elapsed without any objections being raised; as a result I'm going to merge this. Thanks everyone! |
Rendered RFC
This RFC proposes to extend the Wasmtime API to allow users to define host
functions in a
Config
that can be shared between multiple engines andtherefore stores.
Today,
Func
is used to define host functions, but it is tied to aStore
.If users desire short-lived stores to ensure short-lived instances, host
functions need to be redefined upon every module instantiation.
By defining host functions with a
Config
, instances can be createdwithout having to redefine the host functions; this will make for faster module
instantiations in scenarios where a module is repeatedly instantiated.