It does already exist in the form of WebAssembly. It can run outside of the web without any issue, despite the name. And has strong sandboxing build in to it, making it the perfect system if you have to run untrusted code. https://en.m.wikipedia.org/wiki/WebAssembly