Talk about (debug-enable 'warn-deprecated) etc.
[bpt/guile.git] / README
1 !!! This is not a Guile release; it is a source tree retrieved via
2 anonymous CVS or as a nightly snapshot at some random time after the
3 Guile 1.6 release. If this were a Guile release, you would not see
4 this message. !!! [fixme: zonk on release]
5
6 This is a 1.7 development version of Guile, Project GNU's extension
7 language library. Guile is an interpreter for Scheme, packaged as a
8 library that you can link into your applications to give them their
9 own scripting language. Guile will eventually support other languages
10 as well, giving users of Guile-based applications a choice of
11 languages.
12
13 Guile versions with an odd middle number, i.e. 1.7.* are unstable
14 development versions. Even middle numbers indicate stable versions.
15 This has been the case since the 1.3.* series.
16
17 The next stable release will be version 1.8.0.
18
19 Please send bug reports to bug-guile@gnu.org.
20
21 See the LICENSE file for the specific terms that apply to Guile.
22
23
24 Additional INSTALL instructions ===========================================
25
26 Generic instructions for configuring and compiling Guile can be found
27 in the INSTALL file. Guile specific information and configure options
28 can be found below, including instructions for installing SLIB.
29
30 Guile can use a number of external packages such as `readline' when
31 they are available. Guile expects to be able to find these packages
32 in the default compiler setup, it does not try to make any special
33 arrangements itself. For example, for the `readline' package, Guile
34 expects to be able to find the include file <readline/readline.h>,
35 without passing any special `-I' options to the compiler.
36
37 If you installed an external package, and you used the --prefix
38 installation option to install it somewhere else than /usr/local, you
39 must arrange for your compiler to find it by default. If that
40 compiler is gcc, one convenient way of making such arrangements is to
41 use the --with-local-prefix option during installation, naming the
42 same directory as you used in the --prefix option of the package. In
43 particular, it is not good enough to use the same --prefix option when
44 you install gcc and the package; you need to use the
45 --with-local-prefix option as well. See the gcc documentation for
46 more details.
47
48
49 Special Instructions For Some Systems =====================================
50
51 We would like Guile to build on all systems using the simple
52 instructions above, but it seems that a few systems still need special
53 treatment. If you can send us fixes for these problems, we'd be
54 grateful.
55
56 <none yet listed>
57
58 Guile specific flags Accepted by Configure =================================
59
60 If you run the configure script with no arguments, it should examine
61 your system and set things up appropriately. However, there are a few
62 switches specific to Guile you may find useful in some circumstances.
63
64 --with-threads --- Build with thread support
65
66 Build a Guile executable and library that supports multi-threading.
67
68 The default is to enable threading support when your operating
69 system offsers 'POSIX threads'. When you do not want threading, use
70 `--without-threads'.
71
72 --enable-deprecated=LEVEL
73
74 Guile may contain features that are `deprecated'. When a feature is
75 deprecated, it means that it is still there, but that there is a
76 better way of achieving the same thing, and we'd rather have you use
77 this better way. This allows us to eventually remove the old
78 implementation and helps to keep Guile reasonably clean of historic
79 baggage.
80
81 Deprecated features are considered harmful; using them is likely a
82 bug. See below for the related notion of `discouraged' features,
83 which are OK but have fallen out of favor.
84
85 See the file NEWS for a list of features that are currently
86 deprecated. Each entry will also tell you what you should replace
87 your code with.
88
89 To give you some help with this process, and to encourage (OK,
90 nudge) people to switch to the newer methods, Guile can emit
91 warnings or errors when you use a deprecated feature. There is
92 quite a range of possibilities, from being completely silent to
93 giving errors at link time. What exactly happens is determined both
94 by the value of the `--enable-deprecated' configuration option when
95 Guile was built, and by the GUILE_WARN_DEPRECATED environment
96 variable.
97
98 It works like this:
99
100 When Guile has been configured with `--enable-deprecated=no' (or,
101 equivalently, with `--disable-deprecated') then all deprecated
102 features are omitted from Guile. You will get "undefined
103 reference", "variable unbound" or similar errors when you try to
104 use them.
105
106 When `--enable-deprecated=LEVEL' has been specified (for LEVEL not
107 "no"), LEVEL will be used as the default value of the environment
108 variable GUILE_WARN_DEPRECATED. A value of "yes" is changed to
109 "summary" and "shutup" is changed to "no", however.
110
111 When GUILE_WARN_DEPRECATED has the value "no", nothing special
112 will happen when a deprecated feature is used.
113
114 When GUILE_WARN_DEPRECATED has the value "summary", and a
115 deprecated feature has been used, Guile will print this message at
116 exit:
117
118 Some deprecated features have been used. Set the environment
119 variable GUILE_WARN_DEPRECATED to "detailed" and rerun the
120 program to get more information. Set it to "no" to suppress
121 this message.
122
123 When GUILE_WARN_DEPRECATED has the value "detailed", a detailed
124 warning is emitted immediatly for the first use of a deprecated
125 feature.
126
127 The default is `--enable-deprecated=yes'.
128
129 In addition to setting GUILE_WARN_DEPRECATED in the environment, you
130 can also use (debug-enable 'warn-deprecated) and (debug-disable
131 'warn-deprecated) to enable and disable the detailed messaged at run
132 time.
133
134 --disable-discouraged
135
136 In addition to deprecated features, Guile can also contain things
137 that are merely `discouraged'. It is OK to continue to use these
138 features in old code, but new code should avoid them since there are
139 better alternatives.
140
141 There is nothing wrong with a discouraged feature per se, but they
142 might have strange names, or be non-standard, for example. Avoiding
143 them will make your code better.
144
145 --disable-shared --- Do not build shared libraries.
146 --disable-static --- Do not build static libraries.
147
148 Normally, both static and shared libraries will be built if your
149 system supports them.
150
151 --enable-debug-freelist --- Enable freelist debugging.
152
153 This enables a debugging version of scm_cell and scm_double_cell,
154 and also registers an extra primitive, the setter
155 `gc-set-debug-check-freelist!'.
156
157 Configure with the --enable-debug-freelist option to enable the
158 gc-set-debug-check-freelist! primitive, and then use:
159
160 (gc-set-debug-check-freelist! #t) # turn on checking of the freelist
161 (gc-set-debug-check-freelist! #f) # turn off checking
162
163 Checking of the freelist forces a traversal of the freelist and a
164 garbage collection before each allocation of a cell. This can slow
165 down the interpreter dramatically, so the setter should be used to
166 turn on this extra processing only when necessary.
167
168 --enable-debug-malloc --- Enable malloc debugging.
169
170 Include code for debugging of calls to scm_malloc, scm_realloc, etc.
171
172 It records the number of allocated objects of each kind. This is
173 useful when searching for memory leaks.
174
175 A Guile compiled with this option provides the primitive
176 `malloc-stats' which returns an alist with pairs of kind and the
177 number of objects of that kind.
178
179 --enable-guile-debug --- Include internal debugging functions
180 --disable-arrays --- omit array and uniform array support
181 --disable-posix --- omit posix interfaces
182 --disable-networking --- omit networking interfaces
183 --disable-regex --- omit regular expression interfaces
184
185
186 Cross building Guile =====================================================
187
188 As of guile-1.5.x, the build process uses compiled C files for
189 snarfing, and (indirectly, through libtool) for linking, and uses the
190 guile executable for generating documentation.
191
192 When cross building guile, you first need to configure, build and
193 install guile for your build host.
194
195 Then, you may configure guile for cross building, eg:
196
197 ./configure --host=i686-pc-cygwin --disable-shared
198
199 A C compiler for the build system is required. The default is
200 "PATH=/usr/bin:$PATH cc". If that doesn't suit it can be specified
201 with the CC_FOR_BUILD variable in the usual way, for instance
202
203 ./configure --host=m68k-unknown-linux-gnu CC_FOR_BUILD=/my/local/gcc
204
205 Guile for the build system can be specified similarly with the
206 GUILE_FOR_BUILD variable, it defaults to just "guile".
207
208
209 Using Guile Without Installing It =========================================
210
211 The top directory of the Guile sources contains a script called
212 "pre-inst-guile" that can be used to run the Guile that has just been
213 built.
214
215
216 Installing SLIB ===========================================================
217
218 In order to use SLIB from Guile you basically only need to put the
219 `slib' directory _in_ one of the directories on Guile's load path.
220
221 The standard installation is:
222
223 1. Obtain slib from http://www-swiss.ai.mit.edu/~jaffer/SLIB.html
224
225 2. Put it in Guile's data directory, that is the directory printed when
226 you type
227
228 guile-config info pkgdatadir
229
230 at the shell prompt. This is normally `/usr/local/share/guile', so the
231 directory will normally have full path `/usr/local/share/guile/slib'.
232
233 3. Start guile as a user with write access to the data directory and type
234
235 (use-modules (ice-9 slib))
236
237 at the Guile prompt. This will generate the slibcat catalog next to
238 the slib directory.
239
240 SLIB's `require' is provided by the Guile module (ice-9 slib).
241
242 Example:
243
244 (use-modules (ice-9 slib))
245 (require 'primes)
246 (prime? 7)
247
248
249 Guile Documentation ==================================================
250
251 If you've never used Scheme before, then the Guile Tutorial
252 (guile-tut.info) is a good starting point. The Guile Reference Manual
253 (guile.info) is the primary documentation for Guile. The Goops object
254 system is documented separately (goops.info). A copy of the R5RS
255 Scheme specification is included too (r5rs.info).
256
257 Info format versions of this documentation are installed as part of
258 the normal build process. The texinfo sources are under the doc
259 directory, and other formats like Postscript, PDF, DVI or HTML can be
260 generated from them with Tex and Texinfo tools.
261
262 The doc directory also includes an example-smob subdirectory which has
263 the example code from the "Defining New Types (Smobs)" chapter of the
264 reference manual.
265
266 The Guile WWW page is at
267
268 http://www.gnu.org/software/guile/guile.html
269
270 It contains a link to the Guile FAQ.
271
272 About This Distribution ==============================================
273
274 Interesting files include:
275
276 - LICENSE, which contains the exact terms of the Guile license.
277 - COPYING, which contains the terms of the GNU General Public License.
278 - INSTALL, which contains general instructions for building/installing Guile.
279 - NEWS, which describes user-visible changes since the last release of Guile.
280
281 Files are usually installed according to the prefix specified to
282 configure, /usr/local by default. Building and installing gives you:
283
284 Executables, in ${prefix}/bin:
285
286 guile --- a stand-alone interpreter for Guile. With no arguments, this
287 is a simple interactive Scheme interpreter. It can also be used
288 as an interpreter for script files; see the NEWS file for details.
289 guile-config --- a Guile script which provides the information necessary
290 to link your programs against the Guile library.
291 guile-snarf --- a script to parse declarations in your C code for
292 Scheme-visible C functions, Scheme objects to be used by C code,
293 etc.
294
295 Libraries, in ${prefix}/lib. Depending on the platform and options
296 given to configure, you may get shared libraries in addition
297 to or instead of these static libraries:
298
299 libguile.a --- an object library containing the Guile interpreter,
300 You can use Guile in your own programs by linking against this.
301 libguilereadline.a --- an object library containing glue code for the
302 GNU readline library.
303
304 libguile-srfi-*.a --- various SRFI support libraries
305
306 Header files, in ${prefix}/include:
307
308 libguile.h, guile/gh.h, libguile/*.h --- for libguile.
309 guile-readline/readline.h --- for guile-readline.
310
311 Support files, in ${prefix}/share/guile/<version>:
312
313 ice-9/* --- run-time support for Guile: the module system,
314 read-eval-print loop, some R4RS code and other infrastructure.
315 oop/* --- the Guile Object-Oriented Programming System (GOOPS)
316 scripts/* --- executable modules, i.e., scheme programs that can be both
317 called as an executable from the shell, and loaded and used as a
318 module from scheme code. See scripts/README for more info.
319 srfi/* --- SRFI support modules. See srfi/README for more info.
320
321 Automake macros, in ${prefix}/share/aclocal:
322
323 guile.m4
324
325 Documentation in Info format, in ${prefix}/info:
326
327 guile --- Guile reference manual.
328
329 guile-tut --- Guile tutorial.
330
331 GOOPS --- GOOPS reference manual.
332
333 r5rs --- Revised(5) Report on the Algorithmic Language Scheme.
334
335
336 The Guile source tree is laid out as follows:
337
338 libguile:
339 The Guile Scheme interpreter --- both the object library
340 for you to link with your programs, and the executable you can run.
341 ice-9: Guile's module system, initialization code, and other infrastructure.
342 guile-config:
343 Source for the guile-config script.
344 qt: A cooperative threads package from the University of Washington,
345 which Guile can use. If you configure Guile with the
346 --with-threads flag, you will need to link against the -lqt
347 library, found in this directory. Qt is under a separate
348 copyright; see `qt/README' for more details.
349 guile-readline:
350 The glue code for using GNU readline with Guile. This
351 will be build when configure can find a recent enough readline
352 library on your system.
353 doc: Documentation (see above).
354
355 Anonymous CVS Access and FTP snapshots ===============================
356
357 We make the developers' working Guile sources available via anonymous
358 CVS, and by nightly snapshots, accessible via FTP. See the files
359 `ANON-CVS' and `SNAPSHOTS' for details.
360
361 If you would like to receive mail when people commit changes to the
362 Guile CVS repository, you can subscribe to guile-cvs@gnu.org by the
363 Mailman mailing list interface at
364
365 <http://mail.gnu.org/mailman/listinfo/guile-cvs>
366
367
368 Obtaining Guile ======================================================
369
370 The latest official Guile release is available via anonymous FTP from
371
372 ftp://ftp.gnu.org/pub/gnu/guile/guile-1.4.tar.gz
373
374 The mailing list `guile-user@gnu.org' carries discussions, questions,
375 and often answers, about Guile. To subscribe, use the Mailman mailing
376 list interface at <http://mail.gnu.org/mailman/listinfo/guile-user>
377 Of course, please send bug reports (and fixes!) to bug-guile@gnu.org.