-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add Elixir into 'Language Support' #5582
Conversation
Wasmex author here 👋 I'm happy for wasmex to be included in the list. Thanks @etehtsea for this PR 🎉 |
Thanks for the PR here, and thanks for you work on this @tessi! Before merging this though I'd be curious to ask a few questions about the API of the wasmex package. To be clear though I have no experience with Elixir myself so these are moreso higher level questions. The existing language embeddings of Wasmtime all currently follow roughly the same shape which is more-or-less to take the C API and expose something idiomatic within the language itself. For example most languages have a Looking at wasmex I see though that it has a much longer history than many of the other extensions and additionally has the history of switching wasm engines internally. This has resulted in a pretty different API of the wasmex package than, say, the Python package. For example in the wasmex documentation there's a @tessi I'm curious if this is something you would like to, or have already planned to, handle in the future? Again it's not necessarily required to be added to this list (it's not so formal of a list anyway) but I do at least personally think it would be best for "official" bindings of Wasmtime to have roughly the same look-and-feel. |
+1 for matching the style of the existing Wasmtime packages, especially if we are going to feature it in our README. It probably makes sense to split out a |
Hey :) yes, we recently switched from Wasmer and this is a reason why we're not fully copying wasmtimes API. However, I don't plan to actively copy other packages APIs (or the C API) for the sake of being similar. But I want to expose wasmtimes Rust API and make it Elixir-friendly (which is similar, but not the same I guess). We follow the Rust API, because wasmex is not a C-extension but a Rust-extension to the Erlang/Elixir VM. I see value in being very similar to what wasmtime does - it's just easier to maintain and more straight to understand as a user :) Since I assume the other wasmtime packages are doing similar, I'd say we converge in our APIs over time.
We're not there yet :) But we already have concepts for Engine, Config, Instance and more (no Linker yet and I bet more is missing). We're not 100% where I want to be with memories (it currently assumes one exported memory per instance, which is not always a working assumption). Similar with imports (we can have imported functions, no memories, tables nor globals yet). So there is much left to do, but also many things done already. With that being said, let me go into more detailed answers:
Yes, this is a relict from where I started the project with limited understanding of memories. Eventually, we will switch to the later style.
Thanks for being so polite and kind 💜 But no worries, feel free to expose any shortcomings/differences. I take no offense
I don't intend to switch WASM engines again. There was a discussion to support multiple engines, but with me as the only main contributor it's not realistic to maintain multiple engines unless someone pays me to make this my day job 💸 If we ever switch (again, very unlikely), we'd have separate packages for each engine. Next steps for wasmex is to switch to the async wasmtime API with the goal to support ~10k parallel calls into WASM using cooperative time slicing through epoch based interruption. There will be work to wrap WASI std IO into into en Elixir-style messaging. These initiatives are an opinionated way to use wasmtime and are prioritized higher than converging wasmex and wasmtime APIs. However, with every change I intend to bring the APIs closer together if the chance comes. I hope this gives you a good understanding of where we are and where we want to go with wasmex. Feel free to throw more questions at me :) |
Ok that all sounds reasonable enough to me. I think though given the differences from this embedding from other embeddings it migth be good to signal that perhaps. @etehtsea and @tessi would y'all be ok with an |
Ha, as long as it's not "Elixir (horrible)" I'm good ;) We can have another look in a year or so and see if wasmex is more "official" then :) |
SGTM. Maybe break the section up in the README into something like
|
Sure, I've updated the PR. |
wasmex
is usingwasmtime
from the version v0.8.0.Is a library should be somehow verified/approved to get into the list?