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 开发者_StackOverflow社区maybe a ruby library which already do this job?
Best regards, Fabian
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.
I will try the API[1] of ideone.com
[1] http://ideone.com/api
精彩评论