atomic-server
atomic-server copied to clipboard
#73 fp bindgen wasm
#73
fp-bindgen is a tool for creating wasm plugin abstractions. It helps data and functions to pass the memory boundary, from host to plugin.
It's a really cool project. I've been playing with it for a bit and got it working.
Passing Store
across the memory boundary
This is probably the hardest part of it all. I want to be able to do things like Store.query
or query(store)
from within a plugin. To do this, I need a Store available in the plugin. I want to prevent re-creating all the Store
methods in the host (e.g. write a query
and commit
and get_resource
function that the host makes available), which is how it is usually done in fp-bindgen examples.
One of the current limitations of fp-bindgen is sending host context to a runtime. When that is solved, I can start working on this issue.
One possible implementation is a new impl Storelike
that is similar to Db
. Or maybe we can move Db
across the memory boundary without too much effort? It is cloned for every request, so it may not be that hard.
PR Checklist:
- [ ] Link to related issue
- [ ] Add changelog entry linking to issue
- [ ] Added tests (if needed)
- [ ] (If new feature) added in description / readme