Tiny C Compiler – C Scripting Everywhere

Horrible, just plain horrible. Using TCC (Tiny C Compiler) one can write C scripts.

Its features:

  • SMALL! You can compile and execute C code everywhere, for example on rescue disks (about 100KB for x86 TCC executable, including C preprocessor, C compiler, assembler and linker).
  • FAST! tcc generates optimized x86 code. No byte code overhead. Compile, assemble and link several times faster than GCC.
  • UNLIMITED! Any C dynamic library can be used directly. TCC is heading toward full ISOC99 compliance. TCC can of course compile itself.
  • SAFE! tcc includes an optional memory and bound checker. Bound checked code can be mixed freely with standard code.
  • Compile and execute C source directly. No linking or assembly necessary. Full C preprocessor and GNU-like assembler included.
  • C script supported : just add ‘#!/usr/local/bin/tcc -run’ at the first line of your C source, and execute it directly from the command line.
  • With libtcc, you can use TCC as a backend for dynamic code generation.

(Emphasis mine)

Even though even considering writing scripts in C is disgusting I must admit that it’s quite cool that it’s possible. Maybe I should play with TCC sometime..