2 ms·
This is completely off topic for the actual article, but I had a bit of fun a while back working out how to make self-executing C and OCaml scripts/programs. I
by rwmj 2y ago
This is completely off topic for the actual article, but I had a bit of fun a while back working out how to make self-executing C and OCaml scripts/programs.
It's an interesting exercise working out what is both a comment in the target language but is also an executable shell script. For C it's reasonably straightforward but for OCaml it's quite subtle:
https://libguestfs.org/nbdkit-cc-plugin.3.html#C-plugin-as-a-self-contained-script https://libguestfs.org/nbdkit-cc-plugin.3.html#C-plugin-as-a...
https://libguestfs.org/nbdkit-cc-plugin.3.html#Using-this-plugin-with-OCaml https://libguestfs.org/nbdkit-cc-plugin.3.html#Using-this-pl...