Open Iskander0 opened 1 year ago
hey @Agathon1 -- apologies, missed this one! 😊
I would be +1 on the ability to load external plugins. One thing to consider, the public interface could probably be looking a little different eg. we could make this work with x = require('plugin.so')
and then be able to call x.something
. I don't have a strong sense on what we need to do to get this working, but I'd be happy to engage with you if you wished to send a PR / proposal.
I extended ABS for myself to be able to call functions from go plugins. Perhaps something like this can be considered for main.
Simplest plugin example :
Compiled with
go build -buildmode=plugin
, can be called from an ABS script like this:The implementation is kind of bad, as it would be nice to be able to get a library "object" instead of having to "name" all loaded plugins, but I like the simplicity of not having to worry about ABS-specific or go-specific types (as is the case with something like luajit ffi, or python C extensions). I can share some code if anyone is interested.