To develop a online Judge, what kind of technology is better for the backend?

Source: Internet
Author: User
is the server backend in PHP or Python? What are the pros and cons of both?

Reply content:

is the server backend in PHP or Python? What are the pros and cons of both?

Online-judge's back end is actually divided into two pieces, one is the web, and the other is judge.

The Web Part is responsible for the input and output, interface display, and the usual web site is no different, whether it is PHP or Python are very fast.

The Judge section requires at least several features:
1. Sandbox, when executing code to ensure the security of the system, the code must be limited to the sandbox.
2. Monitoring calls, because the online execution code is likely to invoke the system's resources (including requests for files, network/system commands), these should be security first, prohibit the execution of some calls.
3. Statistics, most judge are with memory statistics, execution time statistics, so as to calculate the rank or score, so this function is also very important.

So the judge part of these features leads to the need for a language that can precisely control the system, which is why most judge are written in c++/c, and then use SOCKET/IPC to communicate with each other on the web.

At this point Php/python is the front end, which executes the code to the back end of the judge and returns the corresponding result.

If you want to use Php/python to do judge, although theoretically feasible, but actually seemingly no one to do, you need to achieve a lot of things, not the above plan is reliable.

Remember: no strict implementation of the sandbox language is not judge! There is a sandbox but poor performance is also difficult to bear the task of (those virtual machines)

Previously, the university ACM Community used an open source system that was developed using Java.

Write this system, I think it is a running program test results on the line Ah, different languages call different scripts to run the environment is good. The final comparison results, and then the score. easy!

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.