You are looking at historical revision 1661 of this page. It may differ significantly from its current revision.
(This document describes version 2.429)
CHICKEN is a compiler that translates Scheme source files into C, which in turn can be fed to a C-compiler to generate a standalone executable. This principle, which is used by several existing compilers, achieves high portability because C is implemented on nearly all available platforms. An interpreter is also available and can be used as a scripting environment or for testing programs before compilation.
This package is distributed under the BSD license and as such is free to use and modify.
The method of compilation and the design of the runtime-system follow closely Henry Baker's CONS Should Not CONS Its Arguments, Part II: Cheney on the M.T.A. paper and expose a number of interesting properties:
- Consing (creation of data on the heap) is relatively inexpensive, because a generational garbage collection scheme is used, in which short-lived data structures are reclaimed extremely quickly.
- Moreover, call-with-current-continuation is practically for free and CHICKEN does not suffer under any performance penalties if first-class continuations are used in complex ways.
The generated C code is fully tail-recursive.
Some of the features supported by CHICKEN:
- SRFIs 0, 1, 2, 4, 6, 7, 8, 9, 10, 13, 14, 16, 17, 18, 23, 28, 30, 31, 39, 55, 61 and 62.
- Lightweight threads based on first-class continuations
- Pattern matching with Andrew Wright's match package
- Record structures
- An object system with multiple inheritance, multimethods and a meta-object protocol
- Extended comment- and string-literal syntaxes
- Libraries for regular expressions, string handling
- UNIX system calls and extended data structures
- Create interpreted or compiled shell scripts written in Scheme for UNIX or Windows
- Compiled C files can be easily distributed
- Allows the creation of fully self-contained statically linked executables
- On systems that support it, compiled code can be loaded dynamically
This manual is merely a reference for the CHICKEN system and assumes a working knowledge of Scheme.
The manual is split in the following sections:
- Basic mode of operation
- Compiling Scheme files.
- Using the compiler
- Explains how to use CHICKEN to compile programs and execute them.
- Using the interpreter
- Invocation and usage of csi, the CHICKEN interpreter
- Supported language
- The language implemented by CHICKEN (deviations from the standard and extensions).
- Interface to external functions and variables
- Accessing C and C++ code and data.
- Packaging and installing extension libraries.
- Data representation
- How Scheme data is internally represented.
- Bugs and limitations
- Yes, there are some.
- A list of Frequently Asked Questions about CHICKEN (and their answers!).
- A list of some of the people that have contributed to make CHICKEN what it is.
- Links to documents that may be of interest.