Test and Share Your Code On-Line

Codepad is a pastebin that runs your code for you. It was written by Steven Hazel. Codepad works like a compiler or interpreter, not like the read-eval-print loop of an interactive interpreter prompt. If you want to print the value of an expression, you need to use your language’s print command. If your language requires a “main” function, your program won’t work in codepad without one.

Steven has added support for many languages, including PHP, Python, Ruby and Perl.

How it works

Code execution is handled by a supervisor based on geordi. The strategy is to run everything under ptrace, with many system calls disallowed or ignored. Compilers and final executables are both executed in a chroot jail, with strict resource limits. The supervisor is written in Haskell.

“Hello World” examples: http://codepad.org/hello-world

Excellent tool!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s