Incidentally, this is one of the most interesting aspects of the "crank" operating system Temple OS, every program in the language is written in a variant of C that's compiled on the fly, and the shell itself is just a C REPL. I've never used it but found this article very interesting:
http://www.codersnotes.com/notes/a-constructive-look-at-temp...