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

Create algorithm plugin system #45

Open
alanxoc3 opened this issue Sep 9, 2020 · 3 comments
Open

Create algorithm plugin system #45

alanxoc3 opened this issue Sep 9, 2020 · 3 comments

Comments

@alanxoc3
Copy link
Owner

alanxoc3 commented Sep 9, 2020

When I first had this idea, I was thinking that plugins could be in Python. I'm actually against that idea now for a few reasons. One reason is that it is more work to translate between languages. Another is that it forces an extra dependency. And another is that python has quite a big overhead.

But go-plugin looks promising. Technically, the plugin doesn't even have to be written in golang, it could be written in any language. The nice thing about it though is that there are no extra dependencies needed. And everything the plugin would want to use are already available in a module.

So this case is to research into and implement go-plugin or something similar. Plugins should be contained in a folder and the name of the file would be the algorithm name referenced in .concards-meta.

I like this idea. It's pretty solid now. And super lightweight.

@alanxoc3
Copy link
Owner Author

alanxoc3 commented Sep 9, 2020

Adding to this. Should the plugins specify the version they were written for? One minus to this is that I might have to keep track of things in the main codebase. But a plus would be that I could change inputs and outputs for plugins relatively easy.

I guess I should think about how likely the API is to change.

alanxoc3 added a commit that referenced this issue Sep 15, 2020
I moved the meta package to the internal folder. I also created a plugin
module. This would be the only thing that a plugin would need in order
to be dependent on concards.
@alanxoc3
Copy link
Owner Author

About half of this has been addressed in my latest refactor.

@alanxoc3
Copy link
Owner Author

Hmm.. I think plugins could be solved by using hooks. Why not? Kakoune does this. I think terraform kind of works like this.

If I use hooks, then the plugin could be any executable. I just needs a specific name. I'm currently creating a basic listener hook as part of #109. I think this could be extended to algorithms later.

A benefit of hooks is that information is communicated via stdout/stderr. This means the hook program could also be reused for other things.

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

1 participant