Hacker News new | ask | show | jobs
by hawski 2180 days ago
It's obviously not the same, but you can emulate this with a conventional compiler:

  #if 0
  set -e; [ "$0" -nt "$0.bin" ] &&
  cc "$0" -o "$0.bin"
  exec "$0.bin" "$@"
  #endif
  
  #include <stdio.h>

  int
  main(int argc, char *argv[]) {
    puts("Hello world!");
    return 0;
  }
It works, because by default system shell will be spawned.