~ chicken-core (chicken-5) 2bfc14bf8b69129f2ba43945e48c10d24d95b739
commit 2bfc14bf8b69129f2ba43945e48c10d24d95b739 Author: Peter Bex <peter@more-magic.net> AuthorDate: Wed Aug 11 12:07:35 2021 +0200 Commit: Peter Bex <peter@more-magic.net> CommitDate: Wed Aug 11 12:07:35 2021 +0200 Sync manual with wiki Quite a few improvements have been made by our wiki users! diff --git a/manual/Cross development b/manual/Cross development index fe6757fb..d3075cd5 100644 --- a/manual/Cross development +++ b/manual/Cross development @@ -47,7 +47,7 @@ as a temporary place to store the target files. A few things to note: libraries will finally be installed. In this case it will be {{/usr/lib}}. * {{PLATFORM}} determines the target platform. It must be one of the officially -supported platforms CHICKEN runs on. +supported platforms CHICKEN runs on. Note that it actually refer to the extension of a dedicated Makefile (`Makefile.linux` in our case). * {{HOSTSYSTEM}} is an identifier for the target system and will be used as the name prefix of the cross C compiler (in this case {{arm-none-linux-gnueabi-gcc}}). @@ -109,8 +109,8 @@ You should now have these files on {{~/target}}: `-- man1 : -You should now transfer {{libchicken.so}} to the target system, and place -it in {{/usr}}. +You should now transfer {{~/target/usr/lib}} to the target system, and place +its contents in {{/usr/lib}}. You may want to omit the static library {{libchicken.a}} if the target memory is limited. ==== Building the "cross chicken" @@ -133,7 +133,7 @@ Again, unpack a CHICKEN release tarball or a source tree and run into. It is recommended not to install into a standard location (like {{/usr/local}} or {{$HOME}}) - some files will conflict with a normal CHICKEN installation. -* {{TARGETSYSTEM}} gives the name-prefix of the cross C compiler. +* {{TARGETSYSTEM}} gives the name-prefix of the cross C compiler and other tools (C++ compiler, librarian (ar) and ressource compiler (for windows)). * {{PROGRAM_PREFIX}} determines the name-prefix of the CHICKEN tools to be created. @@ -184,21 +184,45 @@ In {{~/cross-chicken}}, you should find the following: To make sure that the right C compiler is used, we ask {{arm-csc}} to show the name of the cross C compiler: - % ~/cross-chicken/arm-csc -cc-name + % ~/cross-chicken/bin/arm-csc -cc-name arm-none-linux-gnueabi-gcc Looks good. +==== Special notes for Linux to Windows cross development + +To cross compile from Linux to Windows, you will need to use a Linux build of MingGW-w64 with you can find in most distribution. + +As far as the runtime is concerned, the procedure is the same that what have been shown before, using the platform name {{cross-linux-mingw}}. + +The procedure to compile the compiler however require some more care: +* The platform name is {{linux}} because it is where you want your compiler to run +* You have to set the {{TARGET_LIBRARIES}} as this is different between Linux and Windows: + For Linux target, this variable contains {{-ldl -lm}}, while for Windows target it should be {{-lm -lws2_32}}. +* You have to make sure you are pointing to the right toolchain (see next paragraph). + +In order to compile the C sources that Chicken will produce you have to make sure that you provide the right toolchain in both runtime and compiler steps. + +In most cases, you want to do that by setting {{HOSTSYSTEM}} when building the runtime and {{TARGETSYSTEM}} when building the compiler to something similar to {{x86_64-w64-mingw32}} (check you distribution binaries). + +If your distribution does not stick to the {{PREFIX-TOOLNAME}} convention you may want to set some following variables (runtime step/compiler step): +* {{C_COMPILER}}/{{TARGET_C_COMPILER}} +* {{CXX_COMPILER}}/{{TARGET_CXX_COMPILER}} +* {{LIBRARIAN}}/{{TARGET_LIBRARIAN}} for {{ar}} +* {{RC_COMPILER}}/{{TARGET_RC_COMPILER}} for {{windres}} + +You may need this trick to pick {{x86_64-w64-mingw32-gcc-posix}} over {{x86_64-w64-mingw32-gcc-win32}} in Debian for example (those correspond to different thread APIs). + === Using it ==== Compiling simple programs - % ~/cross-chicken/arm-csc -v hello.scm + % ~/cross-chicken/bin/arm-csc -v hello.scm /home/felix/cross-chicken/arm-cross-chicken/bin/arm-chicken hello.scm -output-file hello.c -quiet arm-none-linux-gnueabi-gcc hello.c -o hello.o -c -fno-strict-aliasing -DHAVE_CHICKEN_CONFIG_H -g -Wall \ -Wno-unused -I /home/felix/cross-chicken/arm-chicken/include rm hello.c - arm-none-linux-gnueabi-gcc hello.o -o hello -L/home/felix/cross-chicken/arm-chicken/lib -Wl,-rpath=/usr/lib -lm \ + arm-none-linux-gnueabi-gcc hello.o -o hello -L/home/felix/cross-chicken/arm-chicken/lib -Wl,-R/usr/lib -lm \ -ldl -lchicken rm hello.o @@ -228,7 +252,7 @@ extension, like the import library of modules. One option is to copy the import-library source file into the repository of the host compiler: # optionally, you can compile the import library: - # ~/cross-chicken/arm-csc -O3 -d0 -s target-only-extension.import.scm + # ~/cross-chicken/bin/arm-csc -O3 -d0 -s target-only-extension.import.scm cp target-only-extension.import.scm ~/cross-chicken/lib/chicken/9 === Final notes diff --git a/manual/Deployment b/manual/Deployment index be2fce02..5252d543 100644 --- a/manual/Deployment +++ b/manual/Deployment @@ -15,7 +15,7 @@ There are several options for distributing software written in CHICKEN for use on other machines or by other people: * Distribute source code, which requires that the target system has a compatible version of CHICKEN installed -* Distribute C files generated from Scheme source code and compile them binaries on the target system - this also requires a matching CHICKEN installation on the target +* Distribute C files generated from Scheme source code and compile them to binaries on the target system - this also requires a matching CHICKEN installation on the target * Distribute compiled binaries, either statically linked or built in such a way that all required extensions and libraries are included in the distribution The rest of this chapter addresses the third option, for which several options exist, @@ -125,7 +125,8 @@ the library that is linked into plain CHICKEN-compiled applications: % cp $CHICKEN_BUILD/chicken-config.h . % cp $CHICKEN_BUILD/buildtag.h . % gcc -Os -fomit-frame-pointer -DHAVE_CHICKEN_CONFIG_H hello.c \ - build-version.c eval.c expand.c internal.c library.c modules.c runtime.c \ + build-version.c chicken-syntax.c eval.c expand.c internal.c \ + library.c modules.c runtime.c \ -o hello -lm Once we have all the files together, we can create a tarball: diff --git a/manual/Egg specification format b/manual/Egg specification format index 73da8566..8512d33d 100644 --- a/manual/Egg specification format +++ b/manual/Egg specification format @@ -120,8 +120,9 @@ cached by egg servers. [egg property] (components COMPONENT ...) -Lists components (extensions, programs, include- or data files) -that this extension installs. See below for information on how +Lists components (extensions, programs, include- or data files) that +this extension installs. See [[#component-types|Component types]] and +[[#component-properties|component properties]] for information on how to specify component-specific information. ==== host @@ -169,7 +170,7 @@ forms for constraining mode and linkage. Signal an error and abort processing. Mostly useful inside {{cond-expand}} forms. -=== Components +=== Component types ==== extension @@ -375,13 +376,12 @@ to this component and that the object components are dependencies. [egg property] (destination NAME) -Specifies an alternative installation destination for the built -component and only applies to components of type {{data}}, {{c-include}} -and {{scheme-include}}. {{NAME}} must be a relative path and is -considered relative to CHICKEN's installation prefix. - -This property should only be used in extreme cases, as it is recommended -to use the default installation locations, which are: +Specifies an alternative installation destination for the +built component and only applies +to components of type {{data}}, {{c-include}} and {{scheme-include}}. +This property should only be used in extreme +cases, as it is recommended to use the default installation +locations, which are: * for C include files: {{<PREFIX>/include/chicken/}} diff --git a/manual/Foreign type specifiers b/manual/Foreign type specifiers index 6a9ac462..afa766dd 100644 --- a/manual/Foreign type specifiers +++ b/manual/Foreign type specifiers @@ -116,8 +116,9 @@ Either a fixnum or a flonum in the range of an (unsigned) machine ''long''. Similar to {{integer32}} on 32-bit systems or {{integer64}} on 64-bit. <type>size_t</type> +<type>ssize_t</type> -A direct mapping to C's {{size_t}}. +A direct mapping to C's {{size_t}} and {{ssize_t}}. === Floating-point @@ -372,6 +373,7 @@ The foreign type {{TYPE}} with an additional {{const}} qualifier. <tr><td>{{[unsigned-]integer64}}</td><td>{{[unsigned] int64_t}}</td></tr> <tr><td>{{[unsigned-]long}}</td><td>{{[unsigned] long}}</td></tr> <tr><td>{{size_t}}</td><td>{{size_t}}</td></tr> +<tr><td>{{ssize_t}}</td><td>{{ssize_t}}</td></tr> <tr><td>{{float}}</td><td>{{float}}</td></tr> <tr><td>{{double}}</td><td>{{double}}</td></tr> <tr><td>{{number}}</td><td>{{double}}</td></tr> diff --git a/manual/Getting started b/manual/Getting started index 70f2595b..b8dba801 100644 --- a/manual/Getting started +++ b/manual/Getting started @@ -94,7 +94,7 @@ to use and modify as long as the original authors are acknowledged. Scheme cognoscenti will appreciate the method of compilation and the design of the runtime-system, which follow closely Henry Baker's -[[http://home.pipeline.com/~hbaker1/CheneyMTA.html|CONS Should Not +[[https://web.archive.org/web/20200223051632/http://home.pipeline.com/~hbaker1/CheneyMTA.html|CONS Should Not CONS Its Arguments, Part II: Cheney on the M.T.A.]] paper and expose a number of interesting properties. @@ -187,11 +187,11 @@ can pretty much ignore the C compiler once you have installed it.) * On Macintosh OS X, you will need the XCode tools, which are installable from the App Store. * On Windows, you have three choices: -* Cygwin ([[http://sourceware.org/cygwin/]]) provides a relatively +* Cygwin ([[https://www.cygwin.com/]]) provides a relatively full-featured Unix environment for Windows. CHICKEN works substantially the same in Cygwin and Unix. * The GNU Compiler Collection has been ported to Windows, in the - MinGW system ([[http://mingw.sourceforge.net]]). Unlike Cygwin, + MinGW system ([[http://mingw-w64.org/]]). Unlike Cygwin, executables produced with MinGW do not need the Cygwin DLLs in order to run. MSYS is a companion package to MinGW; it provides a minimum Unix-style development/build environment, again ported from free @@ -218,8 +218,7 @@ for information about how to obtain them. The simplest development environment is a text editor and terminal window (Windows: Command Prompt, OSX: Terminal, Linux/Unix: xterm) for using the interpreter and/or invoking the compiler. If you install one -of the line editing extensions (e.g., [[/egg/breadline|breadline]], -[[/egg/parley|parley]], [[/egg/linenoise|linenoise]]), you have some +of the line editing extensions (e.g., [[/egg/breadline|breadline]], [[/egg/linenoise|linenoise]]), you have some useful command line editing features in the interpreter (e.g., Emacs or vi-compatible line editing, customization). @@ -529,6 +528,13 @@ name), and that it returns an integer result (the {{int}} before.) Now we can in $ gcc -c fib.c $ csc -o fib-user fib.o fib-user.scm + +If using MinGW on Windows, + + > gcc -c fib.c -o fib.obj + > csc -o fib-user fib.obj fib-user.scm + +Then run the executable. $ ./fib-user 0 1 1 2 3 5 8 13 21 34 55 diff --git a/manual/Module (chicken base) b/manual/Module (chicken base) index fd86d8f6..3f9c3543 100644 --- a/manual/Module (chicken base) +++ b/manual/Module (chicken base) @@ -77,7 +77,7 @@ imaginary component that's nan. This procedure is compatible with the definition from the R7RS {{(scheme inexact)}} library. -==== finite? +==== infinite? <procedure>(infinite? N)</procedure> diff --git a/manual/Module (chicken file) b/manual/Module (chicken file) index b0aea6f9..e78fb91b 100644 --- a/manual/Module (chicken file) +++ b/manual/Module (chicken file) @@ -31,9 +31,9 @@ Copies {{ORIGFILE}} (a string denoting some filename) to {{NEWFILE}}, {{BLOCKSIZE}} bytes at a time. {{BLOCKSIZE}} defaults to 1024, and must be a positive integer. Returns the number of bytes copied on success, or errors on failure. {{CLOBBER}} determines the behaviour -of {{file-copy}} when {{NEWFILE}} is already extant. When set to +of {{copy-file}} when {{NEWFILE}} is already extant. When set to {{#f}} (default), an error is signaled. When set to any other value, -{{NEWFILE}} is overwritten. {{file-copy}} will work across +{{NEWFILE}} is overwritten. {{copy-file}} will work across filesystems and devices and is not platform-dependent. ==== move-file diff --git a/manual/Module (chicken foreign) b/manual/Module (chicken foreign) index e434a41f..f3fcbc49 100644 --- a/manual/Module (chicken foreign) +++ b/manual/Module (chicken foreign) @@ -119,7 +119,7 @@ use {{define-external}} (see the Manual section on [[Callbacks]]). For example, the following code: <enscript lang="scheme"> -(import foreign) +(import (chicken foreign)) (define-foreign-variable x double "var_x") (print x) </enscript> diff --git a/manual/Module (chicken port) b/manual/Module (chicken port) index 543eb481..996b87ff 100644 --- a/manual/Module (chicken port) +++ b/manual/Module (chicken port) @@ -67,7 +67,7 @@ Returns {{#t}} if {{PORT}} is connected to a terminal and <procedure>(terminal-size PORT)</procedure> -Returns two values, the number of columns and rows of the terminal +Returns two values, the number of rows and columns of the terminal that is connected to {{PORT}} or {{0}}, {{0}} if the terminal size can not be obtained. diff --git a/manual/Module (chicken process) b/manual/Module (chicken process) index ed443997..26f225c3 100644 --- a/manual/Module (chicken process) +++ b/manual/Module (chicken process) @@ -25,7 +25,7 @@ current setting of the {{PATH}} environment variable while {{execve(3)}} does no This procedure never returns; it either replaces the process with a new one or it raises an exception in case something went wrong executing the program. -On Windows, these procedures all have an additoinal optional parameter +On Windows, these procedures all have an additional optional parameter {{EXACT-FLAG}}, which defaults to {{#f}}. When {{#f}} is passed, any argument string with embedded whitespace will be wrapped in quotes. When {{#t}} no such wrapping occurs. @@ -179,16 +179,6 @@ which any data written to will be received as input in the sub-process, the process-id of the started sub-process, and an input port from which data written by the sub-process to {{stderr}} can be read. -==== create-session - -<procedure>(create-session)</procedure> - -Creates a new session if the calling process is not a process group leader and returns -the session ID. - -'''NOTE''': On native Windows builds (all except cygwin), this -procedure is unimplemented and will raise an error. - === Shell commands The commands below are all string-based. This means you have to be diff --git a/manual/Module (chicken process-context posix) b/manual/Module (chicken process-context posix) index e3fef57e..171aeb4b 100644 --- a/manual/Module (chicken process-context posix) +++ b/manual/Module (chicken process-context posix) @@ -126,6 +126,12 @@ Get or set the process group ID of the process specified by {{PID}}. '''NOTE''': On native Windows builds (all except cygwin), this procedure is unimplemented and will raise an error. +==== create-session + +<procedure>(create-session)</procedure> + +Creates a new session with the current process as group leader. Returns current process id on success. Equivalent to setsid(2). + ==== user-information <procedure>(user-information USER [AS-VECTOR])</procedure> diff --git a/manual/Module (chicken process-context) b/manual/Module (chicken process-context) index f70292cb..5299905e 100644 --- a/manual/Module (chicken process-context) +++ b/manual/Module (chicken process-context) @@ -24,7 +24,7 @@ the list is a string containing the name of the executing program. The other items are the arguments passed to the application. It depends on the host-shell whether arguments are expanded ('globbed') or not. -=== command-line-arguments +==== command-line-arguments <parameter>(command-line-arguments)</parameter> @@ -40,7 +40,7 @@ Returns a full pathname of the currently-running executable, or {{#f}} if it couldn't be determined. When evaluating code in the interpreter, this will be a path to {{csi}}. -=== program-name +==== program-name <parameter>(program-name)</parameter> diff --git a/manual/Module (chicken random) b/manual/Module (chicken random) index 64e8c19b..1fe3c316 100644 --- a/manual/Module (chicken random) +++ b/manual/Module (chicken random) @@ -27,7 +27,7 @@ random manner as possible. ==== pseudo-random-integer -<procedure>(pseudo-random-integer [RANGE])</procedure> +<procedure>(pseudo-random-integer RANGE)</procedure> Returns a uniformly distributed pseudo random integer between 0 and {{RANGE-1}}, which may be a big integer. diff --git a/manual/Module (chicken string) b/manual/Module (chicken string) index 0790f165..f56f4bdb 100644 --- a/manual/Module (chicken string) +++ b/manual/Module (chicken string) @@ -139,11 +139,11 @@ both strings). === substring-index -<procedure>(substring-index WHICH WHERE [START])</procedure><br> -<procedure>(substring-index-ci WHICH WHERE [START])</procedure> +<procedure>(substring-index MAYBE-SUBSTRING STRING [START])</procedure><br> +<procedure>(substring-index-ci MAYBE-SUBSTRING STRING [START])</procedure> -Searches for first index in string {{WHERE}} where string -{{WHICH}} occurs. If the optional argument {{START}} is given, +Searches for first index in string {{STRING}} where string +{{MAYBE-SUBSTRING}} occurs. If the optional argument {{START}} is given, then the search starts at that index. {{substring-index-ci}} is a case-insensitive version of {{substring-index}}. diff --git a/manual/Module (chicken syntax) b/manual/Module (chicken syntax) index eaa7dbd1..2c2d1097 100644 --- a/manual/Module (chicken syntax) +++ b/manual/Module (chicken syntax) @@ -107,7 +107,7 @@ as (else `(,(rename 'if) ,test (,(rename 'begin) ,@(cdr first)) - (,(r 'cond) ,@rest))))))))) + (,(rename 'cond) ,@rest))))))))) In this example the identifier {{else}} is renamed before being passed to the comparison predicate, so the comparison will be true if and diff --git a/manual/Module scheme b/manual/Module scheme index debafa82..ef8c5e41 100644 --- a/manual/Module scheme +++ b/manual/Module scheme @@ -266,7 +266,7 @@ result of the set! expression is unspecified. (+ x 1) ===> 5 As an extension to R5RS, {{set!}} for unbound toplevel variables is -allowed. Also, {{set! (PROCEDURE ...) ...)}} is supported, as CHICKEN +allowed. Also, {{(set! (PROCEDURE ...) ...)}} is supported, as CHICKEN implements [[http://srfi.schemers.org/srfi-17/srfi-17.html|SRFI-17]]. === Derived expression types diff --git a/manual/Modules b/manual/Modules index 66222751..e562f460 100644 --- a/manual/Modules +++ b/manual/Modules @@ -339,6 +339,63 @@ the modules that are referred to by compiled code, and thus the binding information and exported syntax of the former must be available separately. +=== Example of compiling modules and linking them into an executable + +Here is a test module, in the file mymod.scm: + +<enscript highlight=scheme> +(module mymod (hello) + (import scheme) + (define (hello) + (display "Hello, World, I'm in mymod!") + (newline))) +</enscript> + +Here is the main module, in the file trymod.scm: + +<enscript highlight=scheme> +(module trymod () + (import scheme) + (import mymod) + (display "I'm in trymod!") + (newline) + (hello) + (display "Now I'm back in trymod!") + (newline)) +</enscript> + +You can compile mymod.scm into a shared object and compile trymod.scm into an executable trymod that uses that shared object like this: + + csc -s -J mymod.scm + csc trymod.scm + +You can execute trymod and it will load the shared object mymod.so. When loading a shared +object, the CHICKEN runtime uses the libld API to obtain the entry point ("C_toplevel") to invoke top-level initialization code of the module (which also setups up global bindings, etc.). However, if you move the trymod executable to another directory, it won't be able to find mymod.so to load it. If you want include the object into the executable directly, it needs to have a unique entry point name, separate from any other entry point of other linked modules. + +To give the module a name, we pass the "-unit modulename" argument to csc, and the name of the module is added to the entry point, so the entry point for mymod would become "C_mymod_toplevel". Then the "-uses modulename" argument is passed to csc while compiling and linking trymod so it knows to use that entry point. + +To compile mymod.scm and trymod.scm and link them into the executable trymod, issue the following commands: + + csc -c -J mymod.scm -unit mymod -o mymod.o + csc -o trymod mymod.o -uses mymod trymod.scm + +This creates an executable that is dynamically linked against libchicken.so, but which includes the mymod.o object file directly. + +To create an executable that is statically linked, issue the following commands: + + csc -c -static -J mymod.scm -unit mymod -o mymod.o + csc -o trymod -static mymod.o -uses mymod trymod.scm + +If you later add another module you'd need to compile it similar to how mymod.scm is +compiled and add a "modulename.o -uses modulename" to the csc command that compiles trymod.scm. + +It is possible to use the csm program installed by the [[/egg/csm|csm egg]] to do this automatically. To produce a dynamically linked program you would do: + + csm -program trymod + +To produce a statically linked program you would do: + + csm -static -program trymod === Functors diff --git a/manual/Types b/manual/Types index da9c6a48..f3fb6b7b 100644 --- a/manual/Types +++ b/manual/Types @@ -128,7 +128,7 @@ or {{:}} should follow the syntax given below: <tr><td>{{list}}</td><td>null or pair</td></tr> <tr><td>{{locative}}</td><td>locative object</td></tr> <tr><td>{{null}}</td><td>empty list</td></tr> -<tr><td>{{number}}</td><td>fixnum or float</td></tr> +<tr><td>{{number}}</td><td>either integer, float, ratnum or cplxnum</td></tr> <tr><td>{{pair}}</td><td>pair</td></tr> <tr><td>{{pointer-vector}}</td><td>vector or native pointers</td></tr> <tr><td>{{pointer}}</td><td>native pointer</td></tr> @@ -257,7 +257,7 @@ definitions in an internal format to {{FILENAME}}. {{-consult-types-file FILENAME}} loads and registers the type-information in {{FILENAME}} which should be a file generated though a previous use -of {{-emit-types-file}} compiler option or {{emit-types-file}} declaration. +of {{-emit-types-file}}. If library code is used with {{import}} and a {{.types}} file of the same name exists in the diff --git a/manual/Using the compiler b/manual/Using the compiler index 68f09908..9060bbaa 100644 --- a/manual/Using the compiler +++ b/manual/Using the compiler @@ -123,7 +123,41 @@ the source text should be read from standard input. ; -optimize-leaf-routines : Enable leaf routine optimization. -; -optimize-level LEVEL : Enables certain sets of optimization options. {{LEVEL}} should be an integer. Level {{0}} is equivalent to {{-no-usual-integrations -no-compiler-syntax}} (no optimization), level {{1} is equivalent to {{-optimize-leaf-routines}} (minimal optimization), level {{2}} is equivalent to {{-optimize-leaf-routines -inline -lfa2}} (enable optimizations that do not break standard compliance, this is the default), level {{3}} is equivalent to {{-optimize-leaf-routines -local -inline -lfa2 -inline-global -specialize}} (maximal optimization, while still "safe"), level {{4}} is equivalent to {{-optimize-leaf-routines -local -inline -lfa2 -inline-global -specialize -unsafe}} (maximal optimization, "unsafe") and any higher level is equivalent to {{-optimize-leaf-routines -block -inline -lfa2 -inline-global -specialize -unsafe -disable-interrupts -no-trace -no-lambda-info -clustering}} (all possible optimizations, "unsafe"). +; -optimize-level LEVEL : Enables certain sets of optimization options. {{LEVEL}} should be an integer. + +<table> +<tr><th>LEVEL</th><th>Equivalent flags</th><th>Explanation</th></tr> +<tr> +<td>0</td> +<td>{{-no-usual-integrations -no-compiler-syntax}}</td> +<td>No optimization</td> +</tr> +<tr> +<td>1</td> +<td>{{-optimize-leaf-routines}}</td> +<td>Minimal optimization</td> +</tr> +<tr> +<td>2 '''(Default)'''</td> +<td>{{-optimize-leaf-routines -inline -lfa2}}</td> +<td>Enable optimizations that do not break standard compliance</td> +</tr> +<tr> +<td>3</td> +<td>{{-optimize-leaf-routines -local -inline -lfa2 -inline-global -specialize}}</td> +<td>Maximal optimization, while still "safe"</td> +</tr> +<tr> +<td>4</td> +<td>{{-optimize-leaf-routines -local -inline -lfa2 -inline-global -specialize -unsafe}}</td> +<td>Maximal optimization, "unsafe"</td> +</tr> +<tr> +<td>5 (or higher)</td> +<td>{{-optimize-leaf-routines -block -inline -lfa2 -inline-global -specialize -unsafe -disable-interrupts -no-trace -no-lambda-info -clustering}}</td> +<td>All possible optimizations, "unsafe"</td> +</tr> +</table> ; -output-file FILENAME : Specifies the pathname of the generated C file. Default is to use the source filename with the extension replaced by {{.c}}. diff --git a/manual/Using the interpreter b/manual/Using the interpreter index 05578431..a74e6dec 100644 --- a/manual/Using the interpreter +++ b/manual/Using the interpreter @@ -68,7 +68,7 @@ to the shell. Any non-numeric result exits with status zero: #;3> When {{csi}} is started with the {{-script}} option, the feature identifier {{chicken-script}} -is defined, so can conditionally execute code depending on wether the file is +is defined, so can conditionally execute code depending on whether the file is executed as a script or normally loaded into the interpreter, say for debugging purposes: <enscript highlight=scheme> @@ -142,7 +142,7 @@ procedure (see [[Module (chicken csi)]]). === Getting error information Interpreted code has some extended debugging information available -that can be used to locate errors and obtaining information about the +that can be used to locate errors and obtain information about the lexical environment that was effective at the point of error. When an error occurs in an evaluated expression, a "call trace" is printed - the list of calls up to the error location. Note that this does not @@ -168,7 +168,7 @@ expression, possibly following the name of the procedure containing the call expression. If the trace-buffer entry contains lexical environment information -than the complete environment of the call site is shown. +then the complete environment of the call site is shown. Use {{,f}} to select a frame by number, if you want to inspect the lexical environment of an earlier frame. The {{,g}} command lets youTrap