4 ms·
Actually, folks usually just use gRPC or Yaegi in Go. You can write an SDK for your software that abstracts all of that away for the plugin developer. See Terr
by cube2222 4y ago
Actually, folks usually just use gRPC or Yaegi in Go. You can write an SDK for your software that abstracts all of that away for the plugin developer.
See Terraform[0], Traefik[1], or OctoSQL[2].
Though I agree plugins would be welcome, especially for performance reasons, though also to be able to compile and load go code into a running go process (JIT-ish).
[0]: https://github.com/hashicorp/terraform https://github.com/hashicorp/terraform
[1]: https://github.com/traefik/traefik https://github.com/traefik/traefik
[2]: https://github.com/cube2222/octosql https://github.com/cube2222/octosql
Disclaimer: author of OctoSQL
- Fire-Dragon-DoL 4y agoWell aware of all that, but as you point out, real plugins would be better. And to be clear they exist, but you have to compile them with the same go version and if any dependency is shared, they need to be exactly the same version. There are also serious limitations in the sharable code
- zimbatm 4y agoI have had cases where Terraform would OOM because each Terraform provider instance maps to a fresh new Go process. Most of the time this approach is not an issue, and it works really well. But you need to be aware that it's best to keep the number of providers in the 0-20 range per root module.