sxm - runtime for the Scheme language
sxm [ options ] file ...
Sxm (a.k.a. CXEMA) is an implementation of the Scheme programming language. It consists of two programs: the runtime module (sxm) providing the core functionality and the interpreter front-end (sxi) that implements the full language on top of the runtime and provides the traditional interactive interface. The language supported by sxi conforms to ANSI standard of Scheme and extended definition of Scheme in R5RS report. Sxi also supports some of more recent SRFI extensions and many features found in the Chez Scheme implementation.
Normally the user invokes sxi optionally specifying one or more source files in the command line. The interpreter loads the input files in order via a standard load procedure and then enters the interactive mode (read-eval-print loop) interpreting the standard input. It prompts the user with the right angle bracket at the beginning of the input line and waits until the complete expression is entered. Than the interpreter compiles the expression, evaluates it and prints the result. The loop is repeated until the end-of-file is reached.
If the "-s" option is specified and the interpreter exits normally via (exit) or by reaching the end of the standard input, the last state of the Scheme system (heap image) is saved to the file specified after the "-s" option. Heap images preserve all runtime data created during the session except for the input state of file ports left opened at the end of the session. To restore the state of the Scheme session saved in a heap image you may run sxm specifying the image file with the "-h" option. Running an image file directly has the same effect (you have to make sure that runtime module is at its standard location to make this work). The interpreter itself is also a heap image built from source files by sxm installer.
If you run sxm with no heap image specified, it will also attempt to load all input files and then enter the read-eval-print loop. However, the language sxm understands is not a full Scheme; its only purpose is to facilitate bootstrapping of the full interpreter.
Sxm recognizes the following command line options:
If the "-h" option is not present, sxm loads every file on the command line. This is usually done as a part of the bootstrap process; the files are used to upgrade the interpreter from "core" to full Scheme. In this scenario, the "-e" option tells sxm to exit after the last input file is loaded and the "-s" option specifies the name of the resulting image file. If the image is intended for interactive use, it is also useful to specify the "-t" option. This will turn on support for session transcripts by forcing the saved image to use special console ports when it detects that the standard input and output streams are attached to a terminal.
If the "-h" option is specified, sxm restores the state saved in the specified image file. In this case, the "-t" and "-e" options are ignored and the files on the command line are loaded by a standard load procedure. On normal exit, if the "-s" option is specified, the state of the system is saved as a new heap image file.
It is possible to prevent sxm from interpreting command line arguments as options by prefixing them with the "--" option. All arguments following the "--" option are treated as files, not options.
The execution of heap images starts with the call of the standard startup procedure stored as a value of the scheme-start parameter. To change the behavior of an image at startup time, a new procedure can be installed before the image is written to the file. Custom startup procedures may interpret command line arguments instead of treating them as files and replace standard read-eval-print loop with a non-interactive calculation.
The only known incompatibility with ANSI and R5RS Scheme specifications is the special treatment of assignments to certain built-in procedures. Sxm inlines calls to a dozen of the most frequently used standard procedures like car and cdr and, in an attempt to to preserve consistency, makes top-level bindings of inline procedures immutable.
Sxm supports the following SRFIs:
COMPATIBILITY WITH CHEZ SCHEME
Sxm provides numerous language and programming environment extensions found in Chez Scheme v.6. There are still a lot of incompatibilities, however. They are listed below in Chez Scheme User's Guide order and with the corresponding section numbers:
Send your bug reports and suggestions to Sergei Egorov <email@example.com>.
|Sergei Egorov (firstname.lastname@example.org)|