Execution of arbitrary classes?

So, I need to load a some string from memory into RAM, and execute it as a class.
Here’s a code example:

function runClassFromMachineCode(...args) {
  // Run the machine code, If it segfaults, return 1.
};
const machineCode = rootFSController.getFile(appData["executable"]).read(); // I've already defined this stuff. All you need you to know is this will load the executable
timer.background(runClassFromMachineCode(apis)); // Run it in the background

If anyone knows knows how to do this in any language (Including assembly), please let me know!