Coming from a modding background and having modded numerous games, I know that C# is practically one of the easiest languages to “monkey patch” thanks to its compilation to CIL, and there are even several libraries made just for this purpose, allowing for injection into and replacement of methods. I was wondering if there are similar tools available for Lua, as it can too compile to intermediary bytecode to execute on VM.
The reason I'm asking is that I want my own game to be as accessible to modding as possible. Particularly I want to allow injection and replacement of arbitrary Lua code, shipping precompiled Lua binaries with my game. If I were to ship raw Lua source code to modders, said injection and replacement would have to be textual and therefore a little awkward (keep in mind that there could be multiple modders wishing to inject their code into the same method).
So, what approach would be the most practical in this situation? Or should I just stick to C#? Thanks!