I thought about compiling this C++ code using Emscripten to WebAssembly. I even did a PoC using isolated-vm, however, I had difficulties in obtaining the stdout (a requirement), as the emsdk does some abstractions.
Then I tried cgroups with namespaces inside Docker, but apparently, I cannot create a cgroup within Docker since it is already running inside a cgroup.
What options do I have left?