We spent a while with some code here to get other languages up and 
running on the iphone.

So far we have perl, php and ruby all 
working with moderate success!  

Perl is probably the most mature, it now has things like DBI, and 
enough modules to get things like slimserver running. 

Perl also has a boot strap you can use to build your own modules on 
an i386 Mac.  You can find out more about it here