#
Chapter 1
Introduction

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.

This package is distributed under the BSD license and as such is free to use and modify. An interpreter is also available and can be used as a scripting environment or for testing programs before compilation.

The method of compilation and the design of the runtime-system follow closely Henry Baker's Cheney on the M.T.A [1] 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, 18, 22, 23, 25, 28, 30, 37 and 39.

- `syntax-case` highlevel macros

- 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, Common LISP style `format`, 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

- On systems that support it, compiled code can be loaded dynamically