Hacker News new | past | comments | ask | show | jobs | submit login

Here is a way to do it without installing a /usr/bin/c.

All you takes is a few lines of shell code to the top of the C file.

http://rosettacode.org/wiki/Multiline_shebang#C

I contributed that, anonymously. Previously, the task had been marked "omit from C", would you believe it!

Also, note the little "Student exercise" below the code. For this to be useful, you want to cache the compiler output; you want to recompile the underlying executable only if the C script has changed.

The inconvenience of invoking C programs obviously isn't the real obstacle to its use as a scripting language, otherwise this kind of thing would be widely used.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: