Chicken (Scheme implementation)

Chicken (Scheme implementation)
Chicken Scheme
Logo for Chicken Scheme
Original author(s) Felix Winkelmann
Developer(s) The Chicken Team
Initial release July 20, 2000; 11 years ago (2000-07-20)[1]
Stable release 4.7.0 / May 25, 2011; 5 months ago (2011-05-25)
Development status Active
Written in Scheme and C
Operating system Cross-platform
Type Programming language
License BSD License
Website call-cc.org
Standard(s) R5RS (mostly)

Chicken is a compiler and interpreter for the Scheme programming language that compiles Scheme code to standard C. It is mostly R5RS compliant and offers many extensions to the standard. Chicken is free software available under the BSD license.

Contents

Focus

Chicken's focus is immediately clear from its tagline: "A practical and portable Scheme system".

Much like Gauche, Chicken's main focus is the practical application of Scheme for writing "real-world" software. Scheme is well-known for its use in computer science curricula and programming language experimentation, but it hasn't seen much use in business and industry.[2] Chicken's community has produced a large set of libraries for performing a variety of tasks. The Chicken wiki (the software running it is also a Chicken program) also contains a list of software that people have written in Chicken.

Chicken's other goal is to be portable. By compiling to portable C (like Gambit and Bigloo), programs written in Chicken can be compiled for common popular platforms like Linux, Mac OS X and other Unix-like systems as well as Windows and Haiku.[3] It also has built-in support for cross-compilation of programs and extensions,[4] which allows it to be used on various embedded platforms.

Design

Like many Scheme compilers, Chicken uses standard C as an intermediate language. A Scheme program is translated into C by the Chicken compiler, and then a C compiler translates the C program into machine code for the target architecture, producing an executable program. The universal availability of C makes it ideal for this purpose.

Chicken's design was inspired by a 1994 paper[5] by Henry Baker that outlined an innovative strategy for Scheme compilation into C. A scheme program is compiled into C functions. These C functions never reach the return statement; instead, they call a new continuation when complete. These continuations are C functions themselves and are passed on as extra arguments to other C functions. They are calculated by the compiler.

So far, this is the essence of continuation-passing style. Baker's novel idea is to use the C stack for the Scheme heap. Hence, normal C stack operations such as automatic variable creation, variable-sized array allocation, and so on can be used. When the stack fills up (that is, the stack pointer reaches the top of the stack), a garbage collection can be initiated. The design used is a copying garbage collector originally devised by C.J. Cheney, which copies all live continuations and other live objects to the heap.[6] Despite this, the C code does not copy C stack frames, only Scheme objects, so it does not require knowledge of the C implementation.

In full, the Scheme heap consists of the C stack as the nursery together with the two heaps required by the generational garbage collector. This approach gives the speed of the C stack for many operations, and it allows the use of continuations as simple calls to C functions. Further, Baker's solution guarantees asymptotic tail recursive behavior, as required by the Scheme language standard. The implementation in the Chicken scheme compiler is even asymptotically safe for space.

Limitations and deviations from the standard

Chicken Scheme is mostly R5RS-compliant.

There is currently a guaranteed maximum of 120 arguments to a procedure. On common platforms, up to 2048 arguments are supported.

Add-on software

Chicken has a large repository of additional libraries and programs called "eggs". This eggs system is quite similar to RubyGems. It too does not integrate with the packaging system of the user's operating system. SWIG also supports Chicken.

See also

References

External links


Wikimedia Foundation. 2010.

Игры ⚽ Поможем написать реферат

Look at other dictionaries:

  • Chicken (disambiguation) — Chicken is a type of domesticated bird. Chicken can also refer to: Chicken (food), the meat of the chicken bird Chicken (game), a typical game studied in game theory An alternative name for the Asian Zodiac animal, the Rooster Chicken, Alaska, a… …   Wikipedia

  • Scheme Now! — (also known as Snow) is a Free initiative to produce a portable API for the production of portable modular Scheme code.Though Scheme has well defined semantics, it does not explain how modules should or could be written, and thus, many different… …   Wikipedia

  • Scheme — Basisdaten Paradigmen: Multi Paradigma: funktional, prozedural, meta Ersche …   Deutsch Wikipedia

  • Scheme — Información general Paradigma multi paradigma Apareció en 1975 …   Wikipedia Español

  • Scheme —  Pour l’article homonyme, voir scheme.  Scheme …   Wikipédia en Français

  • Adamantix — Разработчик Adamantix Team Семейство ОС Debian Последняя версия 1.2.0 23 октября 2006[1] Последняя …   Википедия

  • Egg — may refer to the following:Biology*Egg (biology), an ovum together with its shell or outer layer, internal membranes and nutrients for the embryo. *Egg cell or ovum, a haploid female reproductive cell or gamete. *Oocyte, an immature egg… …   Wikipedia

  • Continuation-passing style — In functional programming, continuation passing style (CPS) is a style of programming in which control is passed explicitly in the form of a continuation. Gerald Jay Sussman and Guy L. Steele, Jr. coined the phrase in AI Memo 349 (1975), which… …   Wikipedia

  • List comprehension — A list comprehension is a syntactic construct available in some programming languages for creating a list based on existing lists. It follows the form of the mathematical set builder notation (set comprehension) as distinct from the use of map… …   Wikipedia

  • OpenGL — Original author(s) Silicon Graphics Developer(s) Khronos Group Stable release 4.2 …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”