Open spflaumer opened 1 year ago
there would be 2 ways of implementing that kind of behaviour:
* using the [`plugin`](https://pkg.go.dev/plugin) package: * or the [`net/rpc`](https://pkg.go.dev/net/rpc) package. imo plugin is easier to setup overall while rpc might be more configurable
Plugin implementation was one of the things that stumped me back then and go hasn't really advanced in that regard over the past few years. The native plugin
support being unavailable on Windows ruled it out for me, most people use a Windows PC to run emulators for mobile games.
I also considered IPC based implementations like hashicorp's go-plugin
, but I don't think the added complication would have been a good experience for developers writing a plugin or users to use. Ultimately I just left it as a framework of sorts.
WASM has matured a lot more in general and on go, so I think it's possible to run WASM programs as limited plugins in a go program. But ultimately, go was, and still isn't a good language for plugin development compared to IL/interpreted languages like C#, python, js, which also have existing MITM libraries to take advantage of.
The native plugin support being unavailable on Windows ruled it out for me, most people use a Windows PC to run emulators for mobile games.
This is why i suggested net/rpc
: you can run a separate program and handle all the plugin stuff via rpc. The only problem is how to generalize the Interfacing with the main program. The data sent back and forth could be encoded in JSON, for example.
i'm gonna spend some time tinkering with a concept and share a gist once i deem it useable
it seems like i have some sort of solution? although i have not tested this approach yet, it seems that it would be possible to:
i will test that and create a gist with working code or return with empty hands and declare temporary defeat
Should i reimplement modules as loadable shared libraries? the basic idea is stolen from here: