If you can figure out a way to get C++ working well in your silo'd environment, I will gladly shell out whatever you are asking.
As far as I know, things like Emscripten (https://github.com/kripken/emscripten/wiki) can compile C/C++ to JS, but the compilation itself doesn't happen in JS.