I\'ve embedded lua together with a bytecode chunk into a project written in C. Now when I extend my lua code base by adding .lua files, is there a way to keep this code in a sin
loadstring is what your looking for. It takes a string and loads if (after compiling it to byte code if necessary). It results in a function that can be executed to run the contained code afterwards.
If you still need something more general, take a look at load which lets you specify a function to feed the chunks in.
Both functions can process both Lua source code and compiled byte code.