binfmtc - binfmt_misc C 脚本接口

  • Introducing the binfmt_misc C scripting interface: C programmers with certain symptoms (loving C, enjoying writing in C, etc.) can now use C for scripting with binfmtc. It's a hack that allows using C instead of perl or shell. Also included is a "real csh" example for everyday sysadmin work with a different tint.
  • Screenshots: Show examples of execution in C, assembly, C++, and real csh.
  • Usage: Add a magic keyword /*BINFMTC: compile-time options and give execution permission to the C-script. The compiler will compile and execute the program each time the script is invoked.
  • How to install: For sid, add a line to /etc/apt/sources.list and do apt-get update and install binfmtc. The deb line is deb http://www.netfort.gr.jp/~dan... /.
  • Mechanics behind it: By registering magic through Linux binfmt_misc, binfmtc-interpreter is invoked when a C script is run. It parses the script, invokes gcc with options, compiles to a temporary binary, and then invokes the binary.
  • Future plans: Included various language support like gcj, g77, gpc, gnat, gobjc, chill, mono/pnet c#, and using binfmt-support. Some have been completed (gcj, g77, gpc), while others are in progress.
  • References: Links to Downloads, tcc -run (similar to binfmtc for C), and c repl (better c shell than realcsh).
阅读 8
0 条评论