~ chicken-core (chicken-5) /chicken.mdoc
Trap1.\" Copyright (c) 2007-2022, The CHICKEN Team
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\" notice, this list of conditions and the following disclaimer in the
11.\" documentation and/or other materials provided with the distribution.
12.\" 3. The name of the authors may not be used to endorse or promote products
13.\" derived from this software without specific prior written permission.
14.\"
15.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
16.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18.\" IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
19.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25.\"
26.\"
27.Dd Apr 26, 2017
28.Dt CHICKEN 1
29.Os
30.Sh NAME
31.Nm chicken
32.Nd A Scheme-to-C translator
33.Sh SYNOPSIS
34.Nm
35.Op Ar OPTION ...
36.Op Ar FILENAME ...
37.Sh DESCRIPTION
38.Nm
39is a compiler and interpreter for the programming language Scheme
40supporting most of the features as described in the
41Revised^5 Report on the Algorithmic Language Scheme.
42The
43.Nm
44program is the basic Scheme-to-C translator used in this system.
45For a more convenient interface, see
46.Xr csc 1 .
47.Pp
48.Ar FILENAME
49should be a complete source file name with extension, or
50.Dq -
51for standard input.
52.Ar OPTION
53may be one of the following:
54.Pp
55General options:
56.Bl -tag -width Ds
57.It Fl help
58Display usage and exit.
59.It Fl version
60Display compiler version and exit.
61.It Fl release
62Print release number and exit.
63.It Fl verbose
64Display information on compilation progress.
65.El
66.Pp
67File and pathname options:
68.Bl -tag -width Ds
69.It Fl output-file Ar FILENAME
70Specifies output-filename, default is
71.Dq out.c .
72.It Fl include-path Ar PATHNAME
73Specifies alternative path for included files.
74.It Fl to-stdout
75Write compiled file to stdout instead of file.
76.El
77.Pp
78Language options:
79.Bl -tag -width Ds
80.It Fl feature Ar SYMBOL
81Register feature identifier.
82.It Fl no-feature Ar SYMBOL
83Disable built-in feature identifier.
84.El
85.Pp
86Syntax related options:
87.Bl -tag -width Ds
88.It Fl case-insensitive
89Don't preserve case of read symbols.
90.It Fl keyword-style Ar STYLE
91Allow alternative keyword syntax
92.Po prefix, suffix or none Pc .
93.It Fl no-parentheses-synonyms
94Disables list delimiter synonyms.
95.It Fl no-symbol-escape
96Disables support for escaped symbols.
97.It Fl r5rs-syntax
98Disables the CHICKEN extensions to R5RS syntax.
99.It Fl compile-syntax
100Macros are made available at run-time.
101.It Fl emit-import-library Ar MODULE
102Write compile-time module information into separate file.
103.It Fl emit-all-import-libraries
104Emit import-libraries for all defined modules.
105.It Fl no-compiler-syntax
106Disable expansion of compiler-macros.
107.It Fl module Ar NAME
108Wrap compiled code in module of the given name.
109.It Fl module-registration
110Always generate module registration code, even when import libraries are emitted.
111.It Fl no-module-registration
112Do not generate module registration code. Overrides
113.Fl module-registration .
114.El
115.Pp
116Translation options:
117.Bl -tag -width Ds
118.It Fl explicit-use
119Do not use units
120.Sq library
121and
122.Sq eval
123by default.
124.It Fl static
125Link extensions statically.
126.It Fl check-syntax
127Stop compilation after macro-expansion.
128.It Fl analyze-only
129Stop compilation after first analysis pass.
130.El
131.Pp
132Debugging options:
133.Bl -tag -width Ds
134.It Fl no-warnings
135Disable warnings.
136.It Fl debug-level Ar NUMBER
137Set level of available debugging information.
138.It Fl no-trace
139Disable tracing information.
140.It Fl profile
141Executable emits profiling information.
142.It Fl profile-name Ar FILENAME
143Name of the generated profile information file.
144.It Fl accumulate-profile
145Executable emits profiling information in append mode.
146.It Fl no-lambda-info
147Omit additional procedure-information.
148.It Fl types Ar FILENAME
149Load additional type database.
150.It Fl emit-types-file Ar FILENAME
151Write type-declaration information into file.
152.El
153.Pp
154Optimization options:
155.Bl -tag -width Ds
156.It Fl optimize-level Ar NUMBER
157Enable certain sets of optimization options.
158.It Fl optimize-leaf-routines
159Enable leaf routine optimization.
160.It Fl no-usual-integrations
161Standard procedures may be redefined.
162.It Fl unsafe
163Disable all safety checks.
164.It Fl local
165Assume globals are only modified in current file.
166.It Fl block
167Enable block-compilation.
168.It Fl disable-interrupts
169Disable interrupts in compiled code.
170.It Fl fixnum-arithmetic
171Assume all numbers are fixnums.
172.It Fl disable-stack-overflow-checks
173Disables detection of stack-overflows.
174.It Fl inline
175Enable inlining.
176.It Fl inline-limit Ar LIMIT
177Set inlining threshold.
178.It Fl inline-global
179Enable cross-module inlining.
180.It Fl specialize
181Perform type-based specialization of primitive calls.
182.It Fl emit-inline-file Ar FILENAME
183Generate file with globally inlinable procedures
184.Po implies Fl inline Fl local Pc .
185.It Fl consult-inline-file Ar FILENAME
186Explicitly load inline file.
187.It Fl no-argc-checks
188Disable argument count checks.
189.It Fl no-bound-checks
190Disable bound variable checks.
191.It Fl no-procedure-checks
192Disable procedure call checks.
193.It Fl no-procedure-checks-for-usual-bindings
194Disable procedure call checks only for usual bindings.
195.It Fl no-procedure-checks-for-toplevel-bindings
196Disable procedure call checks for toplevel bindings.
197.It Fl strict-types
198Assume variable do not change their type.
199.It Fl clustering
200Combine groups of local procedures into dispatch loop.
201.It Fl lfa2
202Perform additional lightweight flow-analysis pass.
203.It Fl unroll-limit Ar LIMIT
204Specifies inlining limit for self-recursive calls.
205.El
206.Pp
207Configuration options:
208.Bl -tag -width Ds
209.It Fl unit Ar NAME
210Compile file as a library unit.
211.It Fl uses Ar NAME
212Declare library unit as used.
213.It Fl heap-size Ar NUMBER
214Specifies heap-size of compiled executable.
215.It Fl nursery Ar NUMBER Fl stack-size Ar NUMBER
216Specifies nursery size of compiled executable.
217.It Fl extend Ar FILENAME
218Load file before compilation commences.
219.It Fl prelude Ar EXPRESSION
220Add expression to front of source file.
221.It Fl postlude Ar EXPRESSION
222Add expression to end of source file.
223.It Fl prologue Ar FILENAME
224Include file before main source file.
225.It Fl epilogue Ar FILENAME
226Include file after main source file.
227.It Fl dynamic
228Compile as dynamically loadable code.
229.It Fl require-extension Ar NAME
230Require and import extension
231.Ar NAME .
232.It Fl emit-link-file Ar FILENAME
233Write a list of statically linked extensions to
234.Ar FILENAME ,
235used for identifying the static objects that need to be linked to an
236executable.
237.El
238.Pp
239Obscure options:
240.Bl -tag -width Ds
241.It Fl debug Ar MODES
242Display debugging output for the given modes.
243.It Fl raw
244Do not generate implicit init- and exit code.
245.It Fl emit-external-prototypes-first
246Emit prototypes for callbacks before foreign declarations.
247.It Fl regenerate-import-libraries
248Always emit import libraries, even when their contents haven't changed.
249The default behaviour is to preserve existing import libraries.
250.It Fl ignore-repository
251Do not refer to repository for extensions.
252.It Fl setup-mode
253Prefer the current directory when locating extensions.
254.El
255.Sh ENVIRONMENT
256The following environment variables change the behaviour of
257.Nm Ns :
258.Bl -tag -width CHICKEN_INCLUDE_PATH
259.It Ev CHICKEN_INCLUDE_PATH
260Contains one or more pathnames where the compiler should additionally look for
261include-files, separated by
262.Sq \&;
263characters.
264.It Ev CHICKEN_OPTIONS
265Holds a string of default compiler options that should apply to every invocation of
266.Nm .
267.El
268.Sh EXIT STATUS
269.Ex -std
270.Sh SEE ALSO
271.Xr chicken 1 ,
272.Xr chicken-install 1 ,
273.Xr chicken-uninstall 1
274.Pp
275More information can be found in the
276.Lk http://wiki.call-cc.org/manual/index "CHICKEN User's Manual".
277.Sh AUTHORS
278.An The CHICKEN Team
279.Sh BUGS
280Submit bug reports by e-mail to
281.Mt chicken-janitors@nongnu.org