NAME
SBCL -- Steel Bank Common LispDESCRIPTION
SBCL is an implementation of ANSI Common Lisp, featuring a high-performance native compiler, native threads on several platforms, a socket interface, a source-level debugger, a statistical profiler, and much more.RUNNING SBCL
To run SBCL, type "sbcl". After startup messages a prompt ("*") appears. Enter a Lisp expression, and SBCL will read and execute it, print any values returned, give you another prompt, and wait for your next input.$ sbcl
...[startup messages elided]...
* (+ 1 2 3)
6
* (exit)
COMMAND LINE SYNTAX
For ordinary interactive use, no command line arguments should be necessary.- sbcl [runtime options] --end-runtime-options [toplevel options] --end-toplevel-options [user options]
- --core <corefilename>
- Use the specified Lisp core file instead of the default. (See the FILES section for the standard core, or the system documentation for SB-EXT:SAVE-LISP-AND-DIE for information about how to create a custom core.) Note that if the Lisp core file is a user-created core file, it may run a nonstandard toplevel which does not recognize the standard toplevel options.
- --dynamic-space-size <megabytes>
- Size of the dynamic space reserved on startup in megabytes. Default value is platform dependent.
- --control-stack-size <megabytes>
- Size of control stack reserved for each thread in megabytes. Default value is 2.
- --noinform
- Suppress the printing of any banner or other informational message at startup. (This makes it easier to write Lisp programs which work cleanly in Unix pipelines. See also the "--noprint" and "--disable-debugger" options.)
- --disable-ldb
- Disable the low-level debugger. Only effective if SBCL is compiled with LDB.
- --lose-on-corruption
- There are some dangerous low level errors (for instance, control stack exhausted, memory fault) that (or whose handlers) can corrupt the image. By default SBCL prints a warning, then tries to continue and handle the error in Lisp, but this will not always work and SBCL may malfunction or even hang. With this option, upon encountering such an error SBCL will invoke ldb (if present and enabled) or else exit.
- --script <filename>
- As a runtime option equivalent to --noinform --disable-ldb --lose-on-corruption --end-runtime-options --script <filename>. See the description of --script as a toplevel option below.
- --merge-core-pages
- When platform support is present, provide hints to the operating system that identical pages may be shared between processes until they are written to. This can be useful to reduce the memory usage on systems with multiple SBCL processes started from similar but differently-named core files, or from compressed cores. Without platform support, do nothing. By default only compressed cores trigger hinting.
- --no-merge-core-pages
- Ensures that no sharing hint is provided to the operating system.
- --help
- Print some basic information about SBCL, then exit.
- --version
- Print SBCL's version information, then exit.
- --sysinit <filename>
- Load filename instead of the default system-wide initialization file. (See the FILES section.)
- --no-sysinit
- Do not load a system-wide initialization file. If this option is given, the --sysinit option is ignored.
- --userinit <filename>
- Load filename instead of the default user initialization file. (See the FILES section.)
- --no-userinit
- Do not load a user initialization file. If this option is given, the --userinit option is ignored.
- --eval <command>
- After executing any initialization file, but before starting the read-eval-print loop on standard input, read and evaluate the command given. More than one --eval option can be used, and all will be read and executed, in the order they appear on the command line.
- --load <filename>
- This is equivalent to --eval '(load "<filename>")'. The special syntax is intended to reduce quoting headaches when invoking SBCL from shell scripts.
- --noprint
- When ordinarily the toplevel "read-eval-print loop" would be executed, execute a "read-eval loop" instead, i.e. don't print a prompt and don't echo results. Combined with the --noinform runtime option, this makes it easier to write Lisp "scripts" which work cleanly in Unix pipelines.
- --disable-debugger
- By default when SBCL encounters an error, it enters the builtin debugger, allowing interactive diagnosis and possible intercession. This option disables the debugger, causing errors to print a backtrace and exit with status 1 instead -- which is a mode of operation better suited for batch processing. See the User Manual on SB-EXT:DISABLE-DEBUGGER for details.
- --quit
- At the end of toplevel option processing, exit SBCL with a successful code of zero. Note that the effect of this option is delayed until after toplevel options following this one.
- --non-interactive
- This option disables the read-eval-print loop for both exceptional and non-exceptional reasons. It is short for --disable-debugger and --quit in combination and is useful for batch uses where the special option processing implied by --script is not desired.
- --script <filename>
- Implies --no-sysinit --no-userinit --disable-debugger --end-toplevel-options. Causes the system to load the specified file and exit immediately afterwards, instead of entering the read-eval-print loop. If the file begins with a shebang line, it is ignored.
- 1.
- Debugger is disabled, if requested.
- 0[step].
- Any system initialization file is loaded, unless prohibited.
- 0[step].
- Any user initialization file is loaded, unless prohibited.
- 0[step].
- --eval and --load options are processed in the order given.
OVERVIEW
SBCL is derived from the CMU CL. (The name is intended to acknowledge the connection: steel and banking are the industries where Carnegie and Mellon made the big bucks.)* (require 'asdf)
* (require 'sb-bsd-sockets)
THE COMPILER
SBCL inherits from CMU CL the "Python" native code compiler. (Though we often avoid that name in order to avoid confusion with the scripting language also called Python.) This compiler is very clever about understanding the type system of Common Lisp and using it to optimize code, and about producing notes to let the user know when the compiler doesn't have enough type information to produce efficient code. It also tries (almost always successfully) to follow the unusual but very useful principle that "declarations are assertions", i.e. type declarations should be checked at runtime unless the user explicitly tells the system that speed is more important than safety.SYSTEM REQUIREMENTS
SBCL currently runs on X86 (Linux, FreeBSD, OpenBSD, and NetBSD), X86-64 (Linux), PPC (Linux), SPARC (Linux and Solaris 2.x), and MIPS (Linux). For information on other ongoing and possible ports, see the sbcl-devel mailing list, and/or the web site.KNOWN BUGS
This section attempts to list the most serious and long-standing bugs. For more detailed and current information on bugs, see the BUGS file in the distribution.(DECLAIM (FTYPE (FUNCTION (T) NULL) SOMETIMES))
(DEFUN SOMETIMES (X) (ODDP X))
(DEFUN FOO (X) (IF (SOMETIMES X) 'THIS-TIME 'NOT-THIS-TIME))
- --
- Multidimensional arrays are inefficient, especially multidimensional arrays of floating point numbers.
- --
- SBCL, like most (maybe all?) implementations of Common Lisp on stock hardware, has trouble passing floating point numbers around efficiently, because a floating point number, plus a few extra bits to identify its type, is larger than a machine word. (Thus, they get "boxed" in heap-allocated storage, causing GC overhead.) Within a single compilation unit, or when doing built-in operations like SQRT and AREF, or some special operations like structure slot accesses, this is avoidable: see the user manual for some efficiency hints. But for general function calls across the boundaries of compilation units, passing the result of a floating point calculation as a function argument (or returning a floating point result as a function value) is a fundamentally slow operation.
REPORTING BUGS
To report a bug, please send mail to the mailing lists sbcl-help or sbcl-devel. You can find the complete mailing list addresses on the web pages at <http://sbcl.sourceforge.net/>; note that as a spam reduction measure you must subscribe to the lists before you can post. (You may also find fancy SourceForge bug-tracking machinery there, but don't be fooled. As of 2002-07-25 anyway, we don't actively monitor that machinery, and it exists only because we haven't been able to figure out how to turn it off.)DIFFERENCES FROM CMU CL
SBCL can be built from scratch using a plain vanilla ANSI Common Lisp system and a C compiler, and all of its properties are specified by the version of the source code that it was created from. This clean bootstrappability was the immediate motivation for forking off of the CMU CL development tree. A variety of implementation differences are motivated by this design goal.SUPPORT
Various information about SBCL is available at <http://www.sbcl.org/>. The mailing lists there are the recommended place to look for support.AUTHORS
Dozens of people have made substantial contributions to SBCL and its subsystems, and to the CMU CL system on which it was based, over the years. See the CREDITS file in the distribution for more information.ENVIRONMENT
- SBCL_HOME
- This variable controls where files like "sbclrc", "sbcl.core", and the add-on "contrib" systems are searched for. If it is not set, then sbcl looks in ../lib/sbcl/ relative to the location of the executable, or in the current directory. If your executable is in the default location /usr/local/bin/ then it will look in /usr/local/lib/sbcl/.
FILES
- sbcl
- executable program containing some low-level runtime support and a loader, used to read sbcl.core
- sbcl.core
- dumped memory image containing most of SBCL, to be loaded by the `sbcl' executable. Looked for in $SBCL_HOME, unless overridden by the --core option.
- sbclrc
- optional system-wide startup script, looked for in $SBCL_HOME then /etc, unless overridden by the --sysinit command line option.
- .sbclrc
- optional per-user customizable startup script (in user's home directory, or as specified by --userinit)
SEE ALSO
Full SBCL documentation is maintained as a Texinfo manual. If it has been installed, the command- info sbcl
- /usr/local/share/doc/sbcl/
$Date$ | 7th Edition |