atsopt


The command atsopt directly invokes the ATS-compiler for typechecking ATS (source) code and then compiling it into C (target) code. Sometimes, the name of the command is choosen to be patsopt.

Environment Variables

  • ATSHOME: This variable stores the path to the directory where the ATS programming language system is installed. It must be set properly in order for atsopt to function correctly.
  • ATSHOMERELOC: This variable stores the current version of ATS. It is no longer needed in ATS2 (ATS/Postiats).
  • Option-controlling Flags

  • -v: It is a shorthand for --version.
  • --version: It is for printing out the version of atsopt.
  • -cc: It is a shorthand for --compile.
  • --compile: This flag indicates that a call to the ATS-compiler is to perform typechecking and then translate ATS (source) code into C (target) code (after typechecking passes). This option is turned on by default.
  • -tc: It is a shorthand for --typecheck.
  • --typeckeck: This flag indicates that a call to the ATS-compiler is only required to perform typechecking and it should not attempt to translate ATS (source) code into C (target) code.
  • --gline: This flag indicates that line pragma information is to be generated in the C (target) code.
  • --debug: This flag indicates to the ATS-compiler the need for reporting more informative error messages.
  • --debug2: This flag indicates to the ATS-compiler the need for reporting even more informative error messages.
  • -dep: It is a shorthand for --depgen.
  • --depgen: This flag indicates that a call to the ATS-compiler is for generateing file-dependency information, which is often needed for contructing a Makefile.
  • -tag: It is a shorthand for --taggen.
  • --taggen: This flag indicates that a call to the ATS-compiler is for generateing syntax-tagging information, which can then be used to generate ctags for vim and etags for emacs.
  • --DATS: This flag indicates that the next argument, which should be name or name/value pair (separated by the symbol =), is to be passed as a toplevel definition for the ATS-compiler.
  • --IATS: This flag indicates that the next argument is to be passed as an include-path for the ATS-compiler.
  • -o: It is a shorthand for --output.
  • --output: This flag is interpreted as --output-w by default. If it follows --output-a, then it is interpreted as --output-a. If it follows --output-w, then it is interpreted as --output-w.
  • --output-a: This flag indicates that (1) the next argument is interpreted as the name of a file for storing the output generated by a subseqent call to the ATS-compiler and (2) the file is to be opened with the mode "a" (appending).
  • --output-w: This flag indicates that (1) the next argument is interpreted as the name of a file for storing the output generated by a subseqent call to the ATS-compiler and (2) the file is to be opened with the mode "w" (overwriting).
  • -s: It is a shorthand for --static.
  • --static: This flag indicates that the next argument is interpreted as the name of a file containing static ATS code. Usually, this file name ends with the extension .sats.
  • -d: It is a shorthand for --dynamic.
  • --dynamic: This flag indicates that the next argument is interpreted as the name of a file containing dynamic ATS code. Usually, this file name ends with the extension .dats.
  • --pkgreloc: This flag indicates that a call to the ATS-compiler is for generateing a script (in JSON) that can be passed to the command atspkgreloc to perform relocation of remotely located files referenced in the processed ATS source code.
  • --tlcalopt-disable: This flag indicates to the ATS-compiler that tail-call optimization (that turns a recursive tail-call into a local jump) is to be suspended. For instance, the flag should be used for compiling ATS to Erlang as the latter does its own tail-call optimization.
  • --constraint-export: This flag indicates to the ATS-compiler that the constraints generated during typechecking should be exported (in JSON format).
  • --constraint-ignored: This flag indicates to the ATS-compiler that the constraints generated during typechecking should be entirely ignored. For instance, doing so can be justified if constraint-solving is performed externally.