Write C code inline with your Ruby code

Ruby Inline is an analog to Perl's Inline::C. Out of the box, it allows you to embed C/++ external module code in your ruby script directly. By writing simple builder classes, you can teach how to cope with new languages (fortran, perl, whatever).

I downloaded it (simply download the gem and install it) and tapped out the following code, and it worked just great:

This works a treat on OS X. Linux should be fine, but on Windows I can't imagine it running unless you're under Cygwin and have gcc handy. Just watch out for creating infinite loops, because you will need kill -9.

Supposedly Ruby Inline also has support for languages other than C, although C is the only one to work 'out of the box'.