I did not understand what you meant by "custom VM" and
how that could be helpful.
Any way I think about this, shared or static, it seems
inevitable that I would need to have some wrappers on top
of or at least version-decorated Lua API types and
functions. And macros, because they are heavily used. That
seems rather messy to maintain even for one Lua version,
and for multiple it can become a problem in itself. Any
ideas here?
I statically linked 2 versions of Lua once in the same executable.
It involved compiling one version of Lua as C++ and wrapping a
namespace around each file for minimal change.