Our great sponsors
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
But I can assure you that Wasmer will implement this once browsers do (if they ever do, of course)
[1]: https://github.com/wasmerio/wasmer/pull/2892
> types other than int
Floating point values are also supported.
> for example strings and what not without the hacks of passing string lengths and addresses?
That's not so much a "hack" per se, so much as it is fundamentally how string types are represented when broken down into their basic components. ARM, x64, etc. interact with strings in similar ways. Tools like wasm-bindgen[1] generate JS wrappers around the raw WASM calls, which wrap the address+length APIs in string accepting ones. For non-web use cases, you might have to roll your own boilerplate or boilerplate generators, but that's straightforward.
> sharing of data. That is can I declare a struct of some sort in the main program, pass that to the webassembly script, operate on it, and return it? Last I looked at that the only thing I could come up with was passing it back and forth as a (pick your format here) json string.
Multiple WASM instances can share a single memory instance without copying data. A non-wasm host will typically copy/serialize data into/out-of WASM memory for simplicitly/convenience/durability, but there are APIs[2][3] that let you directly manipulate WASM memory - and there's nothing stopping you from generating identical structures on both ends and directly using them without copying.
[1]: https://github.com/rustwasm/wasm-bindgen
[2]: https://docs.rs/wasmer/latest/wasmer/struct.Memory.html#meth...
[3]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
No comment on the other points (I also prefer Wasmtime), but:
I believe the linking proposal is dead for now and replaced by the component model: https://github.com/WebAssembly/component-model
The Wasmtime implementation is in progress.