Adding scripting to an application

I just start in a job where they have software to do integrations with different systems.
So far so good but the problem is for each client there is a version of the code.
I think it is betetr idea to have a commom base code, core that applies to all clients and the differences to be handle through some plugins or code extension mechanism external to the core.
They would be with scripts to be executed by the core in a certain predefined event, such as OnLoad, onStart, OnNewFile, etc.
Do you know of any library or documentation that can help me in this task?

Hi @Yamil_Bracho,

A few options come to my mind (in no particular order).

  1. Write “Plugins” as standalone CLI apps and have the core talk to them via stdin/stdout or gRPC.
  2. Add an embedded script interpreter to the core. Right out of my head I know of Lua and JavaScript interpreters - try searching on GitHub for language:go script, language:go Lua, or language:go javascript.
  3. Write plugins in Go and run them using a Go interpreter like Yaegi.

I do not favor any of them over the others.Like so often, the choice depends on the particular use case and requirements.

Thanks a lot for your answer!!!

1 Like

I once used GitHub - milochristiansen/lua: A Lua 5.3 VM and compiler written in Go. to add Lua scripting to some Go code. Milo was very responsive when issues arose.

2 Likes

Thanks a lot !!!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.