atomic-server icon indicating copy to clipboard operation
atomic-server copied to clipboard

#73 wasmer plugin

Open joepio opened this issue 4 years ago • 0 comments

Get Wasmer running, so users can describe endpoints / plugins using Atomic Data + WASM code.

  • So far, this is the only system I actually got running
  • Providing an HTTP / fetch interface is something that wasmer doesn't really seem to have an answer for. Not sure if I should write some wrapper?

#73

Accessing Store data inside wasmer

This seems to be my biggest challenge. How do I access data from within WASM? I basically want to define functions in my WASM context, and call these from outside with arguments and data from the outside. Some of these functions will need access to data from the store. I want them to be able to perform queries. But getting the Query out of WASM, and into the Host (Atomic-Server) sometimes feels impossible.

Approaches:

  • Use WASI pipes, which is basically STDIN + STDOUT. Seems like a really weird API, but at least I can get strings across!
  • Clone data to the wasmer memory / context. Use bincode to serialize struct to memory, pass pointer to function, then read it from wasmer.
  • Have some shared memory, share a pointer (not sure what this means, but it's what feather seems to talk about)
  • UPDATE: Use fp-bindgen! Seems like the most realistic approach for now

joepio avatar Oct 31 '21 21:10 joepio