Something to build executables in $TMPDIR and run them which could look like:
#! /usr/bin/env dune-run
#! dune-run --libraries cmdliner,base
let () = print_string "Hello world\n"
(the second-line of #! is what nix-shell does also
http://chriswarbo.net/projects/nixos/nix_shell_shebangs.html )
Why not, but we might as well use the same syntax as dune files rather than invent something new:
#! /usr/bin/env dune run
#! (libraries cmdliner base) (preprocess (pps ppx_sexp_conv)) ...
...
We should also compile that in the xdg cache dir, to avoid recompiling it on every run. For instance in ~/.cache/dune/scripts/<hash-of-file-contents>/.
Most helpful comment
Why not, but we might as well use the same syntax as dune files rather than invent something new:
We should also compile that in the xdg cache dir, to avoid recompiling it on every run. For instance in
~/.cache/dune/scripts/<hash-of-file-contents>/.