cakeml icon indicating copy to clipboard operation
cakeml copied to clipboard

Use a file-based I/O interface to the compiler

Open xrchz opened this issue 8 years ago • 5 comments

Make the top-level interface to the compiler accept the names of input file(s) on the command line, including a way to specify stdin, and an optional output file instead of stdout. (See comment in #319.) Probably depends on #248 and #354.

xrchz avatar Oct 26 '17 05:10 xrchz

Amongst other things, the .file directive in our .S file template should reflect the actual name of the output file.

xrchz avatar Jan 10 '18 03:01 xrchz

The most annoying issue is that command-line arguments are dealt with in two places:

I suggest moving all options parsing to the main function in compiler64ProgScript.sml, remove the command-line and file-system model arguments from compile_{32,64} and pass the compiler configuration records created from options parsing instead.

Alternatively, one can:

  • Do it the other way around. This seems like more of a hassle, since the main function needs to decide whether to compile at all, or just print a help message, among other things.
  • Keep it the way it is, and keep writing command-line options parsers in two places. I suspect this is one reason why the compiler binary so seldomly receives any updates.

Finally, I don't think #248 is required anymore: it's probably easier to extend the existing ad-hoc options parsing code.

oskarabrahamsson avatar Aug 18 '23 09:08 oskarabrahamsson