## 3.1 Commmand line format

`chicken FILENAME {OPTION}`

`FILENAME` is the complete pathname of the source-file that is to be translated into C. A filename argument of ```-''` specifies that the source text should be read from standard input. Possible options are:

-analyze-only
  Stop compilation after first analysis pass.

-benchmark-mode
  Equivalent to `-debug-level 0 -optimize-level 3` `-fixnum-arithmetic -disable-interrupts -block`.

-block
  Enable block-compilation. When this option is specified, the compiler assumes that global variables are not modified outside this compilation-unit. Specifically, toplevel bindings are not seen by `eval` and unused toplevel bindings are removed.

-case-sensitive
  Enables the reader to read symbols case sensitive. The default is to read non case sensitive. This option registers the `case-sensitive` feature identifier.

-check-syntax
  Aborts compilation process after macro-expansion and syntax checks.

-compile-time-macros-only
  Makes low-level macros (compiled without the `-hygienic` option) only available at compile-time. By default low-level macros are also available at run-time. Note that highlevel-macros (`syntax-case`) defined in compiled code are never available at run-time.

-compress-literals THRESHOLD
  Compiles quoted literals that exceed the size `THRESHOLD` as strings and parse the strings at run-time. This reduces the size of the code and speeds up compile-times of the host C compiler, but has a small run-time performance penalty. The size of a literal is computed by counting recursively the objects in the literal, so a vector counts as 1 plus the count of the elements, a pair counts as the counts of the car and the cdr, respectively. All other objects count 1.

-debug MODES
  Enables one or more compiler debugging modes. `MODES` is a string of characters that select debugging information about the compiler that will be printed to standard output.

  t | show time needed for compilation
  b | show breakdown of time needed for each compiler pass
  o | show performed optimizations
  r | show invocation parameters
  s | show program-size information and other statistics
  a | show node-matching during simplification
  p | show execution of compiler sub-passes
  l | show lambda-lifting information
  m | show GC statistics during compilation
  n | print the line-number database
  c | print every expression before macro-expansion
  x | display information about experimental features
  N | show the real-name mapping table
  U | show expressions after the secondary user pass
  0 | show database before lambda-lifting pass
  L | show expressions after lambda-lifting
  1 | show source expressions
  2 | show canonicalized expressions
  3 | show expressions converted into CPS
  4 | show database after each analysis pass
  5 | show expressions after each optimization pass
  6 | show expressions after each inlining pass
  7 | show expressions after complete optimization
  8 | show database after final analysis
  9 | show expressions after closure conversion

-debug-level LEVEL
  Selects amount of debug-information. `LEVEL` should be an integer.

  - `-debug-level 0` is equivalent to `-no-trace`.

  - `-debug-level 1` does nothing.

-disable-interrupts
  Equivalent to the `(disable-interrupts)` declaration. No interrupt-checks are generated for compiled programs.

-epilogue FILENAME
  Includes the file named `FILENAME` at the end of the compiled source file. The include-path is not searched. This option may be given multiple times.

-explicit-use
  Disables automatic use of the units `library` and `eval`. Use this option if compiling a library unit instead of an application unit.

-extend FILENAME
  Loads a Scheme source file or compiled Scheme program (on systems that support it) before compilation commences. This feature can be used to extend the compiler. This option may be given multiple times.

-feature SYMBOL
  Registers `SYMBOL` to be a valid feature identifier for `cond-expand`.

-fixnum-arithmetic
  Equivalent to `(fixnum-arithmetic)` declaration. Assume all mathematical operations use small integer arguments.

-heap-size NUMBER
  Sets a fixed heap size of the generated executable to `NUMBER` bytes. The parameter may be followed by a `M` (`m`) or `K` (`k`) suffix which stand for mega- and kilobytes, respectively. The default heap size is 5 kilobytes. Note that only half of it is in use at every given time.

-heap-initial-size NUMBER
  Sets the size that the heap of the compiled application should have at startup time.

-heap-growth PERCENTAGE
  Sets the heap-growth rate for the compiled program at compile time (see: `-:hg`).

-heap-shrinkage PERCENTAGE
  Sets the heap-shrinkage rate for the compiled program at compile time (see: `-:hs`).

-help
  Print a summary of available options and the format of the command line parameters and exit the compiler.

-hygienic
  Load ``syntax-case'' macro package and enable high-level macros in compiled code. This option registers the `hygienic-macros` feature identifier.

-hygienic-at-run-time
  Makes hygienic (``syntax-case'') macro system available at run-time. Note that this has a slight overhead, because the hygienic macro definitions have to be loaded. This will only install the standard R5RS macros, plus SRFI-0 (`cond-expand`). To load all further macros, execute:

      (require 'moremacros)

-include-path PATHNAME
  Specifies an additional search path for files included via the `include` special form. This option may be given multiple times. If the environment variable `CHICKEN_INCLUDE_PATH` is set, it should contain a list of alternative include pathnames separated by ```;''`. The environment variable `CHICKEN_HOME` is also considered as a search path.

-keyword-style STYLE
  Enables alternative keyword syntax, where `STYLE` may be either `prefix` (as in Common Lisp) or `suffix` (as in DSSSL). Any other value is ignored.

-lambda-lift
  Enable the optimization known as lambda-lifting.

-no-trace
  Disable generation of tracing information. If a compiled executable should halt due to a runtime error, then a file containing a stack-trace will be written to the current directory under the name `STACKTRACE`. Each line in the created file gives the name and the line-number (if available) of a procedure call. With this option given, the generated code is slightly faster.

-no-feature SYMBOL
  Unregisters feature identifier `SYMBOL`.

-no-warnings
  Disable generation of compiler warnings.

-no-winding-callcc
  Identical to the `(no-winding-callcc)` declaration. All uses of `call-with-current-continuation` do not respect `dynamic-wind` before- and after-thunks.

-nursery NUMBER -stack-size NUMBER
  Sets the size of the first heap-generation of the generated executable to `NUMBER` bytes. The parameter may be followed by a `M` (`m`) or `K` (`k`) suffix. The default stack-size depends on the target platform.

-optimize-leaf-routines
  Enable leaf routine optimization.

-optimize-level LEVEL
  Enables certain sets of optimization options. `LEVEL` should be an integer.

  - `-optimize-level 0` does nothing.

  - `-optimize-level 1` is equivalent to `-optimize-leaf-routines -lambda-lift`.

  - `-optimize-level 2` is equivalent to `-optimize-leaf-routines -lambda-lift -usual-integrations`.

  - `-optimize-level 3` is equivalent to `-optimize-leaf-routines -lambda-lift -usual-integrations -unsafe`.

-output-file FILENAME
  Specifies the pathname of the generated C file. Default is `FILENAME.c`.

-postlude EXPRESSIONS
  Add `EXPRESSIONS` after all other toplevel expressions in the compiled file. This option may be given multiple times. Processing of this option takes place after processing of `-epilogue`.

-prelude EXPRESSIONS
  Add `EXPRESSIONS` before all other toplevel expressions in the compiled file. This option may be given multiple times. Processing of this option takes place before processing of `-prologue`.

-profile
  Instruments the source code to count procedure calls and execution times. After the program terminates (either via an explicit `exit` or implicitly), profiling statistics are written to a file named `PROFILE`. Each line of the generated file contains a list with the procedure name, the number of calls and the time spent executing it. Use the script `formatprofile` to display the profiling information in a more user-friendly form. Enter `formatprofile` with no arguments at the command line to get a list of available options. Note that the file is only important in the compilation of the main compilation unit. For library units the option is still needed (to record procedures defined in that unit), but the filename is ignored.

-prologue FILENAME
  Includes the file named `FILENAME` at the start of the compiled source file. The include-path is not searched. This option may be given multiple times.

-quiet
  Disables output of compile information.

-srfi-7
  Process the source as a SRFI-7 configuration language file (see: the SRFI-7 document 1)

-strict
  Disable non-standard macros. This option registers the `strict` feature identifier.

-strict-srfi-0
  Disable non-standard macros except `cond-expand`. This option registers the `strict` feature identifier.

-strict-reader
  Disables non-standard read syntax.

-strict-letrec
  Enable fully R5RS compliant `letrec`. This generates slightly less efficient code but preserves standard semantics.

-to-stdout
  Write compiled code to standard output instead of creating a `.c` file.

-unit NAME
  Compile this file as a library unit. Equivalent to

      -prelude "(declare (unit NAME))"

-visit FILENAME
  Reads the source-file `FILENAME` and performs macro-expansions. This makes macros/syntax, constant- and inline-function definitions defined in that file available without actually compiling the code.

-unsafe
  Disable runtime safety checks.

-uses NAME
  Use definitions from the library unit `NAME`. This is equivalent to

      -prelude "(declare (uses NAME))"

-usual-integrations
  Specifies that standard procedures and certain internal procedures are never redefined, and can be inlined. This is equivalent to declaring `(usual-integrations)`.

-version
  Prints the version and some copyright information and exit the compiler.

-verbose
  Prints progress information to standard output during compilation.

The environment variable `CHICKEN_OPTIONS` can be set to a string with default command-line options for the compiler.

1 http://srfi.schemers.org/srfi-7/srfi-7.html