WebAssembly support is something to look at for the purpose.
Quote from: Wikipedia
WebAssembly or wasm is an experimental efficient low-level programming language for in-browser client-side scripting, which is currently in development.
WebAssembly is portable bytecode which is designed to be faster to parse than JavaScript, as well as faster to execute.