It does seem like WebAssembly is the answer here, but would be cooler (I think) if that sort of thing was built from scratch.