![]() | |
Family | Lisp |
---|---|
Designed by | Aubrey Jaffer, Tom Lord, Miles Bader |
Developer | GNU Project |
First appeared | 1993; 32 years ago (1993)[1] |
Stable release | |
Platform | IA-32,x86-64,AArch64,armel,armhf,mips,mips64el,mipsel,ppc64el,s390x |
OS | Linux,BSD,Windows (throughMinGW orCygwin) |
License | LGPL-3.0-or-later |
Filename extensions | .scm .go (Guile object) |
Website | gnu |
Influenced by | |
Lisp,Scheme,SCM |
GNU Ubiquitous Intelligent Language for Extensions[3] (GNU Guile) is the preferredextension language system for theGNU Project[4] and features an implementation of the programming languageScheme. Its first version was released in 1993.[1] In addition to large parts of Scheme standards,Guile Scheme includes modularized extensions for many different programming tasks.[5][6]
For extending programs, Guile offerslibguile which allows the language to be embedded in other programs, and integrated closely through theC languageapplication programming interface (API); similarly, newdata types andsubroutines defined through the C API can be made available as extensions to Guile.[7]
Guile is used in many programs under theGNU project umbrella (GDB, Make, Guix,GNU TeXmacs,GnuCash,LilyPond,Lepton-EDA...)[8] but it also sees use outside of that, for example inGoogle's schism.
Guile Scheme is ageneral-purpose,high-level programming language whose flexibility allows expressing concepts in fewerlines of code than would be possible in languages such asC. For example, itshygienic macro system allows adding domain specific syntax-elements without modifying Guile. Guile implements the Scheme standard R5RS, most of R6RS and R7RS,[9] severalScheme Requests for Implementation (SRFI), 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."[10] Thus Guile Scheme (and other languages implemented by Guile) can be extended with newdata types andsubroutines implemented through the C API.
The standard distribution offers modules for Portable Operating System Interface (POSIX) system calls,scheduling, aforeign function interface,S-expression basedXML processing throughSXML, SXPath, and SXSLT,HTTP and otherWorld Wide Web APIs,delimited continuations,array programming,[11] and other functionality.[5][6] Guile programs can use facilities fromSLIB, the portable Scheme library.[12]
When usingcontinuations withcall/cc, a requirement of the Scheme standard, Guile copies the executionstack into theheap and back.[13] Its manual suggests using delimited continuations instead, because they have a more efficient implementation.[14]
Because foreign code may havepointers to Scheme objects, Guile uses the conservativeBoehm–Demers–Weiser (BDW)garbage collector.[15]
The Guile manual gives details of the inception and early history of the language.[16] A brief summary follows:
After the success ofEmacs in thefree software community, as a highly extensible and customizable application via its extension (and partly implementation) languageEmacs Lisp, thecommunity began to consider how this design strategy could apply to the rest of the GNU system. Tom Lord initially began work on an embeddable language runtime named the GNU Extension Language (GEL), which was based on Aubrey Jaffer's Scheme implementationSCM (which in turn was based on George Carrette'sSIOD).[17][18] Lord convincedRichard Stallman to make GEL the official extension language of the GNU project, based on the argument that Scheme was a cleanerLisp dialect than Emacs Lisp, and that GEL could evolve to implement other languages on the same runtime, namely Emacs Lisp. After Lord discovered GEL had a naming conflict with another programming language, he solicited suggestions for a new name. From several contributions in severalUsenet newsgroups, Lord controversially chose Guile from a suggestion by Lee Thomas.[19][20][21][22]
During the development of Guile (then GEL) and before its public release, the extension languageTcl 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 aflamewar known as the "Tcl War".[23] Since the public announcement of the Guile project coincided with the Tcl debate, it has become a common misconception that Guile began as a reaction to this.
After the initial release of Guile, development languished for many years, but 2009–2010 saw major improvements,[24] and Guile 2.0 was released in 2011 with a newcompiler infrastructure, avirtual machine implementation, a switch to theBoehm–Demers–Weiser garbage collector, many improvements to the Guile Scheme language, and other major changes.[25]
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: adialect of Scheme essentially differing only in its C-like syntax, a translation ofEmacs Lisp, a Tcl converter motivated bytkWWW, and something roughly resembling the languageLogo.[26] With version 2.0, the project successfully transitioned to acompiler tower approach, allowing the definition of compilers from one language to another, typically from a higher-level one to a lower-levelintermediate representation, and eventuallyvirtual machinebytecode or nativemachine code.[27][28]
On 16 Mar 2017, Guile 2.2.0 was released with a new optimizing compiler and high-performance register virtual machine. According to the release announcement by Andy Wingo, real-world programs often showed a speedup of 30% or more with Guile 2.2 when compared to the previous 2.0 series. Guile 2.2.0 also lowered memory usage, sped up the "eval" interpreter, provided better support for multi-core programming, and removed any fixed limit on recursive function calls. It also supported the creation of user-space concurrency facilities that multiplex millions of concurrent lightweight "fibers" and provided a complete Emacs-compatible Elisp implementation, implementing all of Elisp's features and quirks in the same way as Emacs.[29]
On 16 January 2020, Guile 3.0.0 was released with just-in-time (JIT) native code generation for much greater performance. Compared to 2.2, microbenchmark performance is around twice as good on the whole, while some individual benchmarks are up to 32 times as fast. It also featured support for interleaved definitions and expressions in lexical contexts, native support for structured exceptions, better support for the R6RS and R7RS Scheme standards and many optimizations.[30][31]
1958 | 1960 | 1965 | 1970 | 1975 | 1980 | 1985 | 1990 | 1995 | 2000 | 2005 | 2010 | 2015 | 2020 | ||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
LISP 1, 1.5,LISP 2(abandoned) | |||||||||||||||
Maclisp | |||||||||||||||
Interlisp | |||||||||||||||
MDL | |||||||||||||||
Lisp Machine Lisp | |||||||||||||||
Scheme | R5RS | R6RS | R7RS small | ||||||||||||
NIL | |||||||||||||||
ZIL (Zork Implementation Language) | |||||||||||||||
Franz Lisp | |||||||||||||||
muLisp | |||||||||||||||
Common Lisp | ANSI standard | ||||||||||||||
Le Lisp | |||||||||||||||
MIT Scheme | |||||||||||||||
XLISP | |||||||||||||||
T | |||||||||||||||
Chez Scheme | |||||||||||||||
Emacs Lisp | |||||||||||||||
AutoLISP | |||||||||||||||
PicoLisp | |||||||||||||||
Gambit | |||||||||||||||
EuLisp | |||||||||||||||
ISLISP | |||||||||||||||
OpenLisp | |||||||||||||||
PLT Scheme | Racket | ||||||||||||||
newLISP | |||||||||||||||
GNU Guile | |||||||||||||||
Visual LISP | |||||||||||||||
Clojure | |||||||||||||||
Arc | |||||||||||||||
LFE | |||||||||||||||
Hy |
There have been several past unfinished attempts to replace or supplement theEmacs Lisp extension language with Guile, parallel to the efforts of supporting other languages in Guile.[citation needed]
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 has begun and made significant progress throughGoogle Summer of Code projects.[32] A Guile-based Emacs could offer better execution performance for Emacs Lisp, support new Emacs Lisp language features more easily, make Guile libraries written in other programming languages available to Emacs Lisp code, and allow writing Emacs extensions in other programming languages supported by Guile, all while remaining fully backward compatible with existing Emacs Lisp code bases.
As of October 2014[update], the implementation had reached a stage where Guile Emacs is able to reliably run most Emacs Lisp code. Remaining problems or possible problems involve the different internal representation of Emacs Lisp strings from Scheme strings, the difference between how Emacs Lisp and Scheme treat the Boolean false and empty list objects, Emacs Lisp macros not integrating with Scheme, Emacs Lisp not having been designed for concurrency, and the portability of Guile to platforms supported by Emacs. Other concerns raised by the Emacs community include the relative sizes of the Emacs and Guile communities, and whether it would cause splitting in the community if Emacs were extensible in programming languages other than Emacs Lisp.[33]
At EmacsConf 2024, the relaunch of Guile-Emacs was announced.[34][35]
GNU make can be built with support for GNU Guile as an embedded extension language.[36]
Guile is the GNU Ubiquitous Intelligent Language for Extensions, the official extension language for the GNU operating system.
scm_cons
, which is the underlying implementation of the Scheme procedurescons
." Blandy 1997, pp. 94, 96.SLIB is not included in the Guile distribution, but can be installed separately.
call/cc
copies the entire C stack into the heap; invoking a continuation copies the stack back from theheap and uses thelongjmp
function to reactivate it. This implementation has a number of drawbacks...", Blandy 1997, p. 99.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 defines a tower of languages, starting at Scheme and progressively simplifying down to languages that resemble the VM instruction set.