I’m a newer and if the question is so easy I apologize for that.
Assume I want to dev a classical online judge system, obviously the core part is
- get users’ code to a file
- compile it on server
- run it on server (with some sandbox things to prevent damage)
- the program exit itself, then check the answer.
- or get the signal of program collapsing.
I wonder if it’s possible to do all the things using Node.js, how to do the sandbox things. Is there any example for compile-sandbox-run-abort-check thing?
additional:
is it more convenient to dev a such system using PYTHON?
thanks in advance.
Most of these steps are standard — create a file, run a system call to compile something, muck around with I/O — I think any language should be able to do them, except the very crucial step of “run in a sandbox.” I am aware of several solutions for sandboxing:
This list is probably not exhaustive. The system I am involved with, http://cscircles.cemc.uwaterloo.ca uses option #1. Again, most of the work is done in system calls so I can’t imagine that one language is so much better than the other? We use php for the big-level stuff and C to do the sandboxing. Does that help answer your question?