GNU Guile
Developer(s) | GNU Project |
---|---|
Stable release | 2.0.9 (April 10, 2013[1]) [±] |
Operating system | GNU, GNU/Linux, BSD, MS Windows (through MinGW or Cygwin) |
Type | Programming language |
License | GNU Lesser General Public License |
Website | Official website |
Standard(s) | R5RS and R6RS |
GNU Guile is the preferred extension system for the GNU Project,[2] which features an implementation of the Scheme programming language. Its first version was released in 1993.[3] In addition to large parts of Scheme standards, Guile Scheme includes modularized extensions for many different programming tasks.[4][5]
For extending programs, Guile offers "libguile" which allows the language to be embedded in other programs, and integrated closely through the C API; similarly, new types and subroutines defined through the C API can be made available as extensions to Guile itself.[6]
Guile stands for the GNU Ubiquitous Intelligent Language for Extensions.[7] It is used in programs like GnuCash and Lilypond.[8]
Guile Scheme
Guile Scheme is a general-purpose, high-level programming language whose flexibility allows programmers to express concepts in fewer lines of code than would be possible in languages such as C. For example its hygienic macro system allows adding domain specific syntax-elements without modifying Guile itself. Guile implements the Scheme standard R5RS, parts of R6RS, several SRFIs, and many extensions of its own.
The core idea of Guile Scheme is that "the developer implements critical algorithms and data structures in C or C++ and exports the functions and types for use by interpreted code. The application becomes a library of primitives orchestrated by the interpreter, combining the efficiency of compiled code with the flexibility of interpretation."[9] Thus Guile Scheme (and other languages implemented by Guile) can be extended with new types and subroutines implemented through the C API.
The standard distribution offers modules for POSIX system calls, scheduling, a foreign function interface, S-expression based XML processing through SXML, SXPath, and SXSLT, HTTP and other Web APIs, delimited continuations, array programming,[10] and other functionality.[4][5] Guile programs can use facilities from SLIB, the portable Scheme library.[11]
Implementation details
When using continuations with call/cc, a requirement of the Scheme standard, Guile copies the execution stack into the heap and back.[12]
Because foreign code may have pointers to Scheme objects, Guile uses the conservative BDW garbage collector.
History
The inception and early history of Guile is detailed in its manual.[13] A brief summary follows.
After the success of Emacs in the free software community, as a highly extensible and customizable application via its extension (and partly implementation) language Emacs Lisp, the community started to consider how this design strategy could be applied to the rest of the GNU system. Tom Lord initially started to work on an embeddable language runtime named "GEL", the GNU Extension Language, which was based on Aubrey Jaffer's Scheme implementation SCM (which itself was based on George Carrette's SIOD).[14][15] Lord convinced Richard Stallman to make GEL the official extension language of the GNU project, based on the argument that Scheme was a cleaner Lisp dialect than Emacs Lisp, and that GEL could evolve to implement other languages on the same runtime, namely Emacs Lisp. After a naming conflict with another programming language, GEL was renamed Guile with the suggestion of Jim Blandy or Lee Thomas.[16]
Around the same time Guile (then GEL) was being developed, and before its public release, the extension language Tcl was gaining popularity and being pushed as a universal extension language. Stallman saw Tcl as being underpowered as an extension language, and posted a criticism to the comp.lang.tcl newsgroup, which initiated the so-called Tcl Wars. Since the public announcement of the Guile project coincided with the Tcl debate, it has become a common misconception that Guile started as a reaction to this.
After the initial release of Guile, development languished for many years, but 2009–10 saw major improvements,[17] and Guile 2.0 was released in 2011 with a new compiler infrastructure, a virtual machine implementation, a switch to the Boehm-Demers-Weiser garbage collector, many improvements to the Guile Scheme language itself, and other major changes.[18]
One of the goals of Guile is to allow other languages to be used alongside Scheme, such that Guile would effectively be a language-neutral runtime environment. Various attempts at this have been made in past versions: a dialect of Scheme essentially differing only in its C-like syntax, a translation of Emacs Lisp, a Tcl converter motivated by tkWWW, and something roughly resembling the Logo programming language.[19] With version 2.0, the project successfully transitioned to a "compiler tower" approach, allowing the definition of compilers from one language to another, typically from a higher-level one to a lower-level intermediate representation, and eventually virtual machine bytecode or native machine code.[20][21]
Emacs integration
There have been a number of past unfinished attempts at replacing or supplementing Emacs's Emacs Lisp (Elisp) extension language with Guile, parallel to the efforts of supporting other languages in Guile.[22] With version 2.0 of Guile, a new attempt at implementing Elisp on the Guile compiler tower and replacing Emacs's Elisp implementation with that of libguile, thus offering very tight integration between Emacs/Elisp and other libguile languages (namely Scheme), has started and made significant progress through Google Summer of Code projects.[23][24][25]
Programs using Guile
- AisleRiot – part of the GNOME Games package[26]
- BoBot++ – an Internet Relay Chat bot extensible in Guile Scheme[27]
- GNUbik
- AutoGen
- gEDA
- GNU Anubis
- GnuCash
- Denemo
- GNU LilyPond
- GNU Make[28]
- GNU MDK
- GNU Robots
- GNU Serveez
- Guix - a functional package manager inspired/fork of NixOS
- GNU TeXmacs
- GnoTime[29]
- Liquid War 6
- mcron – a backwards compatible replacement for Vixie cron written in Guile[30]
- OpenCog[31]
- Scwm
- Skribilo
- Snd (software)
- tkWWW – defunct web browser; was a free GNU browser written and extensible in Tk
- WeeChat – since version 0.3.7[32]
References
- ↑ Courtès, Ludovic (2013-04-10). "GNU Guile 2.0.9 released". info-gnu. http://lists.gnu.org/archive/html/info-gnu/2013-04/msg00005.html. Retrieved 2013-05-19.
- ↑ "GNU coding standards, Which Languages to Use". GNU Project.
- ↑ Blandy 1997, p. 102.
- ↑ 4.0 4.1 "Guile Manual, API Reference". GNU Project.
- ↑ 5.0 5.1 "Guile Manual, Guile Modules". GNU Project.
- ↑ "To encourage customization, Guile provides extensive interfaces, allowing C code to interact with the Scheme world. C code can freely create, access, and mutate Scheme objects; C functions may call Scheme functions and vice versa; C code may add new types to the Scheme world and take advantage of Guile's garbage collection… Most of the standard Scheme procedures are implemented by C functions, visible to Guile clients; for example, applications can call the C function
scm_cons
, which is the underlying implementation of the Scheme procedurescons
." Blandy 1997, pp. 94, 96. - ↑ "GNU Guile (About Guile)". GNU Project. "Guile is the GNU Ubiquitous Intelligent Language for Extensions, the official extension language for the GNU operating system."
- ↑ "Appliactions using Guile". GNU Project.
- ↑ Blandy 1997, p. 87.
- ↑ "Guile Manual, Arrays". GNU Project.
- ↑ "Guile Manual, SLIB". GNU Project. "SLIB is not included in the Guile distribution, but can be installed separately."
- ↑ "Because Guile allows foreign functions and Scheme functions to call each other freely, a Guile continuation may include both C and Scheme stack frames. For simplicity, Guile's implementation of
call/cc
copies the entire C stack into the heap; invoking a continuation copies the stack back from the heap and uses thelongjmp
function to reactivate it. This implementation has a number of drawbacks...", Blandy 1997, p. 99. - ↑ "Guile Manual, History".
- ↑ "It's hard to determine just who designed Guile. A large share of the credit surely belongs to Aubrey Jaffer whose excellent Scheme interpreter, SCM, forms the core of the implementation. The module system was designed and built by Miles Bader…" "An Anatomy of Guile, The Interface to Tcl/Tk", 1995
- ↑ "Here is a very, very brief history of this interpreter. I hope that people involved in its past will contribute more to this document. SIOD: George Carrette wrote SIOD, the earliest version. Although most of this code as been rewritten or replaced over time, the garbage collector from SIOD is still an important part of Guile. SIOD is still actively developed and freely available. It has a very small footprint." Guile Scheme 1995.
- ↑ "The name Guile was first suggested in a Usenet discussion by Lee Thomas." Guile Scheme 1995.
- ↑ Wingo, Andy. "Older blog entries for wingo (starting at number 328)". Advogato.
- ↑ "Guile News". GNU Project.
- ↑ Lord, Thomas (July 1995). "An Anatomy of Guile The Interface to Tcl/Tk" (PostScript). Third Annual Tcl/Tk Workshop. Toronto, Ontario, Canada: Usenix. Retrieved 23 November 2010.
- ↑ "Guile Manual, Other Languages". GNU Project. "Guile is still fundamentally a Scheme, but it tries to support a wide variety of language building-blocks, so that other languages can be implemented on top of Guile."
- ↑ "Guile Manual, Compiler Tower". GNU Project. "Guile defines a tower of languages, starting at Scheme and progressively simplifying down to languages that resemble the VM instruction set."
- ↑ "Guile Emacs". EmacsWiki.
- ↑ "Re. Elisp implementation?". BT Templeton.
- ↑ "GSoC 2012 Guile-Emacs". BT Templeton.
- ↑ "GSoC 2013 Guile-Emacs". BT Templeton.
- ↑ "Aisleriot". GNOME Live!. "The rules for the games have been coded for your pleasure in the GNOME scripting language (Scheme)."
- ↑ "Bobot++ – A Flexible IRC Bot".
- ↑ Paul Smith (2013-10-09). "GNU Make 4.0 released". Retrieved 2013-10-09.
- ↑ "GnoTime – The Gnome Time Tracker".
- ↑ "Mcron". GNU Project. "It is written in pure Guile, and allows configuration files to be written in scheme (as well as Vixie's original format) for infinite flexibility in specifying when jobs should be run."
- ↑ "OpenCog Foundation".
- ↑ "Version 0.3.7 – WeeChat dev news".
- "Guile Scheme". December 1995; specification and history; FSF.
- "An Anatomy of Guile, The Interface to Tcl/Tk" (1995)
- Jim Blandy, "Guile: An Interpreter Core for Complete Applications", Handbook of Programming Languages, Volume IV: Functional and Logic Programming Languages, ed. Peter H. Salus. 1998 (1st edition), Macmillian Technical Publishing; ISBN 1-57870-011-6, pp. 87–104.
External links
- Source code on the GNU Savannah software forge.
- What Is Guile?
- Archives of the Tcl Wars
- "A brief history of guile" (from the Guile manual)
- A 2003 interview with GNU Guile maintainer Marius Vollmer
|