Samiksha Jaiswal (Editor)

GNU Guile

Updated on
Edit
Like
Comment
Share on FacebookTweet on TwitterShare on LinkedInShare on Reddit
Developer(s)
  
Standard(s)
  
R5RS and R6RS

GNU Guile

Initial release
  
1993; 24 years ago (1993)

Stable release
  
2.0.12 (July 14, 2016; 7 months ago (2016-07-14)) [±]

Preview release
  
2.1.4 (September 14, 2016; 5 months ago (2016-09-14)) [±]

Operating system
  
Linux, BSD, MS Windows (through MinGW or Cygwin)

GNU Guile is the preferred extension system for the GNU Project, which features an implementation of the Scheme programming language. Its first version was released in 1993. In addition to large parts of Scheme standards, Guile Scheme includes modularized extensions for many different programming tasks.

Contents

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.

Guile stands for the GNU Ubiquitous Intelligent Language for Extensions. It is used in programs like GnuCash and LilyPond.

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, most 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." 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, and other functionality. Guile programs can use facilities from SLIB, the portable Scheme library.

Implementation details

When using continuations with call/cc, a requirement of the Scheme standard, Guile copies the execution stack into the heap and back.

Because foreign code may have pointers to Scheme objects, Guile uses the conservative BDW garbage collector.

History

The Guile manual gives details of the inception and early history of the language. 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 apply 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). 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 at the suggestion of Jim Blandy or Lee Thomas.

During the development of Guile (then GEL) 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/2010 saw major improvements, 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.

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. 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.

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.

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 started and made significant progress through Google Summer of Code projects. 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 backwards compatible with existing Emacs Lisp code bases.

As of October 2014, 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 with concurrency in mind, 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 other programming languages than Emacs Lisp.

References

GNU Guile Wikipedia


Similar Topics