4 ms·
I can't really answer for C/C++ since I have never done it. But I am doing it currently with C#, there might be things that are similar and might help you start
by aespinoza 15y ago
I can't really answer for C/C++ since I have never done it. But I am doing it currently with C#, there might be things that are similar and might help you start your research.
We are building a Backend as a service named iKnode and does exactly that but with C# classes.
The way it works is: 1) Code classes in a browser. 2) Send Code to a Backend Service, which compiles the code and returns any errors. 3) You can execute the code and get the response back from the server.
The idea is to wrap everything in a SandBox and then compile using CodeDom (.Net libraries). But for C/C++, if it is only one class, it is easy, just call a command line compilation. Capture everything the command line returns and pull it back to the Browser.
The first thing I can think of, is create an agent that interacts with the compilation process using system commands. If you are using Windows and Visual C++ there is a CodeDom extension for managed C++ (C++ CLI). http://msdn.microsoft.com/en-us/library/ms235437(v=vs.80).aspx http://msdn.microsoft.com/en-us/library/ms235437(v=vs.80).as...
If you find a way to do it that is easy and useful, please share, I would be interested in seeing this work.