c++ruby-on-railsruby

Compile C++ online in a Rails Application


I am looking for a compiler to compile C++ source code in a rails application. My idea is to get the source code as input, compile it and give the output back to the browser. Of course it should be secure and not really forwarded to the system C++ compiler. Is there maybe a ruby library which already do this job?


Solution

  • The problem is not the compiler. You're problem is safely executing the code, which is VERY (yes, caps and bold) hard with something as low as C/C++.

    In fact, it's almost impossible, your best bet would be a complete sandbox in which the code is going to be executed. There is no ruby library for this AFAIK, and I highly doubt there ever will be one.