Skip to content
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

use wasm for plugin system #6

Open
amirkhaki opened this issue May 29, 2024 · 1 comment
Open

use wasm for plugin system #6

amirkhaki opened this issue May 29, 2024 · 1 comment

Comments

@amirkhaki
Copy link

amirkhaki commented May 29, 2024

currently it is possible to write plugins for gatewayd in go and also there is a plugin to run js hooks
but it is possible to use wasm, so plugins could be developed in almost any language
projects like lapce zellij use it for their plugin system
check this project too ( https://github.com/knqyf263/go-plugin )

@mostafa
Copy link
Member

mostafa commented May 29, 2024

Hey @amirkhaki,

I had the same idea last year as an internal proposal, and there are some considerations:

  1. The Hashicorp's go-plugin system uses the same approach with gRPC, protobuf and unix domain sockets, and it is technically possible to write plugins in any language that supports gRPC and protobuf. However, I tried to create a plugin (template) in Python, named plugin-template-python, but there were some blockers, so I stopped doing that to focus on more important stuff.
  2. As a matter of fact, GatewayD already uses WebAssembly under the hood in the SDK to enable builds on Windows using the awesome go-pgquery library that uses Wazero internally. This is how the cache plugin has binaries built for Windows. I might revert back to using libpg_query and pg_query_go after they introduced Windows builds, but I haven't found time to do that. Removing reliance on go-pgquery (Wazero) for this means fewer dependencies, smaller binaries and possibly less maintenance overhead.
  3. It would not be as easy to replace the plugin system now, but I am open to ideas and contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants