⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 chicken.texi

📁 Scheme跨平台编译器
💻 TEXI
📖 第 1 页 / 共 5 页
字号:
\input texinfo @c -*- texinfo -*-@settitle Chicken Scheme Reference Manual@setchapternewpage on@copyingCopyright 2007-2008 Felix Winkelmann and the Chicken Team@end copying@titlepage@sp 10@title{Chicken Scheme Reference Manual}@author{Felix Winkelmann and the Chicken Team}@comment  The following two commands start the copyright page.@page@vskip 0pt plus 1fillCopyright 2007-2008 Felix Winkelmann and the Chicken Team@end titlepage@node Top, The User's Manual, (dir), (dir)@top Chicken Scheme Reference ManualThis is the top node.@menu* The User's Manual::* Getting started::* Basic mode of operation::* Using the compiler::* Using the interpreter::* Supported language::* Deviations from the standard::* Extensions to the standard::* Non-standard read syntax::* Non-standard macros and special forms::* Pattern matching::* Declarations::* Parameters::* Unit library::* Unit eval::* Unit data-structures::* Unit ports::* Unit files::* Unit extras::* Unit srfi-1::* Unit srfi-4::* Unit srfi-13::* Unit srfi-14::* Unit srfi-69::* Unit match::* Unit regex::* Unit srfi-18::* Unit posix::* Unit utils::* Unit tcp::* Unit lolevel::* Interface to external functions and variables::* Accessing external objects::* Foreign type specifiers::* Embedding::* Callbacks::* Locations::* Other support procedures::* C interface::* chicken-setup::* Data representation::* Bugs and limitations::* FAQ::* Acknowledgements::* Bibliography::@end menu@node The User's Manual, Getting started, Top, Top@chapter The User's ManualThis is the user's manual for the Chicken Scheme compiler, version 3.4.0@table @b@item @ref{Getting started, Getting started}What is CHICKEN and how do I use it?@item @ref{Basic mode of operation, Basic mode of operation}Compiling Scheme files.@item @ref{Using the compiler, Using the compiler}Explains how to use CHICKEN to compile programs and execute them.@item @ref{Using the interpreter, Using the interpreter}Invocation and usage of @code{csi}, the CHICKEN interpreter@item @ref{Supported language, Supported language}The language implemented by CHICKEN (deviations from the standard and extensions).@item @ref{Interface to external functions and variables, Interface to external functions and variables}Accessing C and C++ code and data.@item @ref{chicken-setup, chicken-setup}Packaging and installing extension libraries.@item @ref{Data representation, Data representation}How Scheme data is internally represented.@item @ref{Bugs and limitations, Bugs and limitations}Yes, there are some.@item @ref{FAQ, FAQ}A list of Frequently Asked Questions about CHICKEN (and their answers!).@item @ref{Acknowledgements, Acknowledgements}A list of some of the people that have contributed to make CHICKEN what it is.@item @ref{Bibliography, Bibliography}Links to documents that may be of interest.@end table@node Getting started, Basic mode of operation, The User's Manual, Top@chapter Getting started@menu* Getting started - Scheme::* Getting started - Chicken::* Getting started - Chicken repositories; websites; and community::* Getting started - Installing Chicken::* Getting started - Development environments::* Getting started - The Read-Eval-Print loop::* Getting started - The compiler::* Getting started - Installing an egg::* Getting started - Accessing C libraries::@end menuChicken 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.  An interpreter is also available and can be used as a scripting environment or for testing programs before compilation.This chapter is designed to get you started with Chicken programming, describing what it is and what it will do for you, and covering basic use of the system. With almost everything discussed here, there is more to the story, which the remainder of the manual reveals. Here, we only cover enough to get you started. Nonetheless, someone who knows Scheme already should be able to use this chapter as the basis for writing and running small Chicken programs. @node Getting started - Scheme, Getting started - Chicken,  , Getting started@section SchemeScheme is a member of the Lisp family of languages, of which Common Lisp and Emacs Lisp are the other two widely-known members. As with Lisp dialects, Scheme features@itemize@item a wide variety of programming paradigms, including imperative, functional, and object-oriented@item a very simple syntax, based upon nested parenthesization@item the ability to extend the language in meaningful and useful ways@end itemizeIn contrast to Common Lisp, Scheme is very minimal, and tries to include only those features absolutely necessary in programming. In contrast to Emacs Lisp, Scheme is not anchored into any one program (Emacs), and has a somewhat more modern language design. Scheme is defined in a document called @emph{The Revised^5 Report on the Algorithmic Language Scheme}, or @emph{R5RS} for short. (Yes, it really has been revised five times, so an expanded version of its name would be @emph{The Revised Revised Revised Revised Revised Report}.)  A newer report, @emph{R6RS}, was  released in 2007, but this report has attracted considerable controversy, and not all Scheme implementations will be made compliant with it. Chicken essentially complies with R5RS. Even though Scheme is consciously minimalist, it is recognized that a language must be more than a minimal core in order to be useful. Accordingly, the Scheme community uses a process known as `Scheme Requests For Implementation' (SRFI, pronounced `SUR-fee') to define new language features. A typical Scheme system therefore complies with one of the Scheme reports plus some or all of the accepted SRFIs. A good starting point for Scheme knowledge is @uref{http://www.schemers.org, http://www.schemers.org}. There you will find the defining reports, FAQs, lists of useful books and other resources, and the SRFIs. The Chicken community is at present developing tutorials for programmers who are new to Scheme but experienced with Python, Ruby, or other languages. These can be found on the Chicken wiki. @node Getting started - Chicken, Getting started - Chicken repositories; websites; and community, Getting started - Scheme, Getting started@section ChickenChicken is an implementation of Scheme that has many advantages.<blockquote> Chicken Scheme combines an optimising compiler with a reasonably fast interpreter.  It supports almost all of R5RS and the important SRFIs. The compiler generates portable C code that supports tail recursion, first-class continuations, and lightweight threads, and the interface to and from C libraries is flexible, efficient, and easy to use.  There are hundreds of contributed Chicken libraries that make the programmer's task easier.  The interpreter allows interactive use, fast prototyping, debugging, and scripting.  The active and helpful Chicken community fixes bugs and provides support.  Extensive documentation is supplied. </blockquote>Chicken was developed by Felix L. Winkelmann over the period from 2000 through 2007. In early 2008, Felix asked the community to take over the responsibility of developing and maintaining the system, though he still takes a strong interest in it, and participates actively. Chicken includes @itemize@item a Scheme interpreter that supports almost all of  R5RS Scheme, with   only a few relatively minor omissions, and with many extensions@item a compatible compiler whose target is C, thus making porting to new   machines and architectures relatively straightforward@itemize@item the C support allows Scheme code to include `embedded' C code,   thus making it relatively easy to invoke host OS or library   functions@end itemize@item a framework for language extensions, library modules that broaden   the functionality of the system@end itemizeThis package is distributed under the @b{BSD license} and as such is free to use and modify.Scheme cognoscenti will appreciate the method of compilation and the design of the runtime-system, which follow closely Henry Baker's @uref{http://home.pipeline.com/~hbaker1/CheneyMTA.html, CONS Should Not CONS Its Arguments, Part II: Cheney on the M.T.A.} paper and expose a number of interesting properties.@itemize@item 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.@item Moreover, @code{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.@end itemizeThe generated C code is fully tail-recursive.Some of the features supported by Chicken:@itemize@item SRFIs 0, 1, 2, 4, 6-19, 23, 25-31, 37-40, 42, 43, 45, 47, 55, 57,   60-63, 66, 69, 72, 78, 85 and 95.@item Lightweight threads based on first-class continuations@item Pattern matching with Andrew Wright's @code{match} package@item Record structures@item Extended comment- and string-literal syntaxes@item Libraries for regular expressions, string handling@item UNIX system calls and extended data structures@item Create interpreted or compiled shell scripts written in Scheme for   UNIX or Windows@item Compiled C files can be easily distributed@item Allows the creation of fully self-contained statically linked executables@item On systems that support it, compiled code can be loaded dynamically@end itemizeChicken has been used in many environments ranging from embedded systems through desktop machines to large-scale server deployments.   The number of language extensions, or @b{eggs}, will soon reach 400, including@itemize@item extended language features@item development tools, such as documentation generators, debugging, and   automated testing libraries@item interfaces to other languages such as Java, Python, and Objective-C@item interfaces to database systems, GUIs, and other large-scale   libraries,@item network applications, such as servers and clients for ftp,   smtp/pop3, irc, and http@item web servers and related tools, including URL parsing, HTML   generation, AJAX, and HTTP session management@item data formats, including XML, JSON, and Unicode support@end itemizeChicken is supported by SWIG (Simplified Wrapper and Interface Generator), a tool that produces quick-and-dirty interface modules for C libraries (@uref{http://www.swig.org, http://www.swig.org}). This chapter provides you with an overview of the entire system, with enough information to get started writing and running small Scheme programs. Subsequent chapters cover

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -