views:

47

answers:

1

How can I integrate programming language interpreter / compiler into a website like Codepad.org or Ideone.com? Is there any opensource solution? How do they ensure that the users do not write destructive code?

I know that Ideone has an API, but I am more interested in a self hosted solution.

+2  A: 

As far as security goes, codepad discusses their security model on their about page.

It sounds like they a) execute everything under a supervisor process that runs programs under ptrace and disallows many system calls; b) execute the compiler, interpreters, and executables chrooted to a resource-limited environment; and c) execute all of this inside VMs.

Hope that helps!

Derrick Turk