Code anywhere: 9 programming languages in your browser

Steven Hazel, the developer behind http://codepad.org/ has a great write up on how he’s using Amazon EC2 to scale codepad as well as taking advantage of its firewalled nature to compile code safely.

Te idea behind codepad is that it acts as both a “code paste” site but it then takes the concept one step further by actually compiling the code and displaying the output in your browser.  The code is then available for 24 hours through a unique URL.  From that URL anyone can view your code and its output and even fork the code to create their own paste.

Here’s a quick example of a little Ruby code:

A simple proc in Codepad

While http://pastie.caboo.se/ seems to be paste site of choice right now within much of the Ruby community, especially with the release of Pastie Packer from Dr Nic, I think codepad will open some eyes with a little more exposure.

It’s also a great service for learning something new or teaching someone else.

Give it a look, you’ve got 9 languages to work with:

  • C
  • C++
  • D
  • Haskell
  • OCaml
  • Perl
  • Python
  • Ruby
  • Scheme
  • Tcl
And if you don’t want to run the code but just want some code formatted correctly with some color styling, you can do that too.
It also runs great on the iPhone, so the next time you’re stuck somewhere with an EDGE connection and want to work on your obfuscated C code contest entry, go for it!