I've wanted to do something like this for a long while now. Seems like an obvious way to make executables of varying “fatness”: for example, starting with some platform-agnostic instruction set (like WebAssembly), and gradually adding natively-compiled pieces that the executable runner could swap in if the machine satisfies various conditions. Want to use some fancy new instruction set extension but you don't know if all your target machines support it? Ship multiple versions of that particular function in the same SQLite-database-based executable, and let the loader decide which function version to use based on the host machine's known capabilities.