If you can write your dynamic extensions in C (not C ++), you can find the Tiny C Compiler . It is available under LGPL, it is compatible with Windows and Linux, as well as a small executable file (or library) of ~ 100 kb in size for the preprocessor, compiler, linker and assembler, all of which it works very quickly. The disadvantage of this, of course, is that it cannot compare with the optimizations you can get with GCC. Another potential downside is that the X86 is only AFAIK.
If you decide to write an assembly, TCC can handle it - the documentation says it supports gas-like syntax and it supports X86 opcodes.
TCC also fully supports ANSI C and is almost fully compatible with C99.
In this case, you can either enable TCC as an executable file with your application, or use libtcc (there is not too much documentation for libtcc online, but it is available in the source package). In any case, you can use tcc to create dynamic or shared libraries or executables. If you went along the path of a dynamic library, you would simply add the Render function (or something else) and dlopen or LoadLibrary , and call Render to finally start the user-created rendering. Alternatively, you can make a standalone executable and popen and execute all your communication through standalone stdin and stdout .
source share