1chibi-scheme(1) General Commands Manual chibi-scheme(1)
2
3
4
6 chibi-scheme - a tiny Scheme interpreter
7
8
10 chibi-scheme [-qQrRfTV] [-I path ] [-A path ] [-D feature ] [-m module
11 ] [-x module ] [-l file ] [-e expr ] [-p expr ] [-t module.id ] [-d im‐
12 age-file ] [-i image-file ] [--] [ script argument ... ]
13
14
16 chibi-scheme is a sample interactive Scheme interpreter for the chibi-
17 scheme library. It serves as an example of how to embed chibi-scheme
18 in applications, and can be useful on its own for writing scripts and
19 interactive development.
20
21 When script is given, the script will be loaded with SRFI-22 semantics,
22 calling the procedure main (if defined) with a single parameter as a
23 list of the command-line arguments beginning with the script name.
24 This works as expected with shell #! semantics.
25
26 Otherwise, if no script is given and no -e or -p options are given an
27 interactive repl is entered, reading, evaluating, then printing expres‐
28 sions until EOF is reached. The repl provided is very minimal - if you
29 want readline completion you may want to wrap it with the rlwrap(1)
30 program. Signals aren't caught either - to enable handling keyboard
31 interrupts you can use the (chibi process) module. For a more sophis‐
32 ticated REPL with readline support, signal handling, module management
33 and smarter read/write you may want to use the (chibi repl) module.
34 This can be launched automatically with: chibi-scheme -R .
35
36 For convenience the default language is the (scheme small) module,
37 which includes every library in the R7RS small standard, and transi‐
38 tively some other dependencies. All of this together is actually quite
39 large, so for a more minimal startup language you'll want to use the -x
40 module option described below. To get a mostly R5RS-compatible lan‐
41 guage, use chibi-scheme -xscheme.r5rs or to get just the core language
42 used for bootstrapping, use chibi-scheme -xchibi or its shortcut chibi-
43 scheme -q .
44
45
47 Space is optional between options and their arguments. Options without
48 arguments may not be chained together.
49
50 To reduce the need for shell escapes, options with module arguments (
51 -m , -x and -R ) are written in a dot notation, so that the module (foo
52 bar) is written as foo.bar .
53
54
55 -V Prints the version information and exits.
56
57 -q "Quick" load, shortcut for chibi-scheme -xchibi This is a slightly
58 different language from (scheme base), which may load faster, and
59 is guaranteed not to load any additional shared libraries.
60
61 -Q Extra "quick" load, shortcut for chibi-scheme -xchibi.primitive
62 The resulting environment will only contain the core syntactic
63 forms and primitives coded in C. This is very fast and guaranteed
64 not to load any external files, but is also very limited.
65
66 -r[main]
67 Run the "main" procedure when the script finishes loading as in
68 SRFI-22.
69
70 -R[module]
71 Loads the given module and runs the "main" procedure it defines
72 (which need not be exported) with a single argument of the list of
73 command-line arguments as in SRFI-22. The name "main" can be
74 overridden with the -r option. [module] may be omitted, in which
75 case it defaults to chibi.repl. Thus chibi-scheme -R is the rec‐
76 ommended means to obtain the advanced REPL.
77
78 -s Strict mode, escalating warnings to fatal errors.
79
80 -f Change the reader to case-fold symbols as in R5RS.
81
82 -T Disables tail-call optimization. This can be useful for debugging
83 in some cases, but also makes it very likely to overflow the
84 stack.
85
86 -hsize[/max_size]
87 Specifies the initial size of the heap, in bytes, optionally fol‐
88 lowed by the maximum size the heap can grow to. size can be any
89 integer value, optionally suffixed by "K", for kilobytes, "M" for
90 megabytes, or "G" for gigabytes. -h must be specified before any
91 options which load or evaluate Scheme code.
92
93 -Ipath
94 Inserts path on front of the load path list.
95
96 -Apath
97 Appends path to the load path list.
98
99 -Dfeature
100 Adds feature to the feature list, useful for cond-expanding dif‐
101 ferent library code.
102
103 -mmodule
104
105 -xmodule
106 Imports module as though "(import module )" were evaluated. If
107 the -x version is used, then module replaces the current environ‐
108 ment instead of being added to it.
109
110 -lfile
111 Loads the Scheme source from the file file searched for in the de‐
112 fault load path.
113
114 -eexpr
115 Evaluates the Scheme expression expr.
116
117 -pexpr
118 Evaluates the Scheme expression expr then prints the result to
119 stdout.
120
121 -tmodule.id
122 Enables tracing for the given identifier id in the module module.
123
124 -dimage-file
125 Dumps the current Scheme heap to image-file and exits. This fea‐
126 ture is still experimental.
127
128 -iimage-file
129 Loads the Scheme heap from image-file instead of compiling the
130 init file on the fly. This feature is still experimental.
131
132 -b Makes stdio nonblocking (blocking by default). Only available when
133 lightweight threads are enabled.
134
135
137 CHIBI_MODULE_PATH
138 A colon separated list of directories to search for module
139 files, inserted before the system default load paths. chibi-
140 scheme searches for modules in directories in the following or‐
141 der:
142
143
144 directories included with the -I path option
145
146 directories included from CHIBI_MODULE_PATH
147
148 system directories
149
150 directories included with -A path option
151
152 If CHIBI_MODULE_PATH is unset, the directories "./lib", and "."
153 are searched in order. Set to empty to only consider -I, system
154 directories and -A.
155
156
157 CHIBI_IGNORE_SYSTEM_PATH
158 If set to anything but "0", system directories (as listed above)
159 are not included in the search paths.
160
161
163 Alex Shinn (alexshinn @ gmail . com)
164
165
167 More detailed information can be found in the manual included in
168 doc/chibi.scrbl included in the distribution.
169
170 The chibi-scheme home-page:
171 https://github.com/ashinn/chibi-scheme/
172
173
174
1754th Berkeley Distribution chibi-scheme(1)