-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Plugins system MVP #455
Plugins system MVP #455
Conversation
cc @kirawi |
I haven't inspected the code nor dug into Wasmtime, so these are just my likely very naive thoughts on how to proceed with a plugin system. I believe that |
Upon a closer look, it seems like we're mostly on the same page. I'm not sure about whether we would want Awesome work overall, though! |
This is looking quite cool so far! If you want to avoid code generation, @kirawi, I've got some experience with an alternative method (passing data over JSON) that I chatted about here: #122 (comment) Happy to help however I can with this! It's exciting work! |
I’ll probably change structure before removing draft and maybe take inspiration from veloren structure a bit.
May I ask you why you prefer to avoid Currently it can only generate bindings for Rust on contents (plugins) side, but long term plan is to support more than that. Alex Crichton in bytecodealliance’s zulip:
( The other sane approach I can think of, is the one pointed by @TheLostLambda:
But the downside is that it requires serializing and deserializing (copying around) data. I believe the approach is well suited to Zellij, but we can probably do better with witx(-bindgen) in Helix specifically and I think code generation is a good tradeoff here.
This will be much welcomed! 😄 |
7693afd
to
ec8755d
Compare
Is there any ETA for this? Maybe some plans to support plugins in alpha stage? |
@CBenoit if you need any help, I can find some time to work on this. I have some experience in integrating WASM for https://github.com/hyperledger/iroha/tree/iroha2-dev |
This is greatly welcomed. No real work happened recently and a lot remains to be done. I’m somewhat keeping an eye on the original issue, but lack the time to actually work on it 😕 |
I've also started work on a wasm plugin system for helix and have raised a draft PR at #2949. I started this second effort before I discovered this already open PR. I started it because it sounded like an interesting challenge and my branch is at a point where I wanted to share what I've done in the hope that it will benefit the existing efforts here. I'd be keen to exchange ideas or answer any questions about what I've done so far which can be summarized as:
|
Since WASM is compiled, is there a reason plugins couldn't define functions that are just called directly, without going through any serialization? I don't know how much it matters for a text editor, but protobuf stop bit based encoding/decoding is very slow compared to just regular structs. Also possibly more relevant is that it's much more complex to debug (reading a hexdump of a struct is much easier). The rykv crate is very polished and gives zero copy structs. |
The issue is that Wasm doesn't have a stable ABI for other languages to interface with, and |
@kirawi Would you be open to using something like It’s still a WASM bindgen tool, but it uses Rust types as the source of truth instead of a specialized DSL. This means that any changes to those types don’t force you to regenerate anything unless you’re specifically working on the plugin bindings, i.e. it can help quite a bit on the workflow side of things. |
Not yet ready, just opening for interested people and tracking my own progression.
Progress
PluginsSystem
PluginsSystem
configuration interface (probably in a [plugins] section inconfig.toml
)