To use actual C as a scripting language, check out TCC!
TCC can also be used to make C scripts, i.e. pieces of C source that you run as a Perl or Python script. Compilation is so fast that your script will be as fast as if it was an executable. You just need to add #!/usr/local/bin/tcc -run at the start of your C source:
To use actual C as a scripting language, check out TCC!
The output of compiling Little is tcl code. See http://www.little-lang.org/why.html
I’m late, but GCC works fine too, works for CGI nicely, here are two one-liners:
» cat demo.sh
#!/opt/misc/chax
void main(void){printf("Content-Type: text/plain\n\n");printf("Hello World!\n");}
» cat /opt/misc/chax
#!/bin/sh
(TMPO=`mktemp`;sed -n '2,$p' "$@"|gcc 2>/dev/null -std=gnu99 -pipe -O2 -x c -o $TMPO - &&$TMPO 2>/dev/null;rm -f $TMPO)
Is there a major mode for this yet?
Actually c-mode works pretty well.