ArticleslgStudy

computer science

GNU Guile

GNU Guile is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand GNU Guile rather than just read about it. In short: GNU Ubiquitous Intelligent Language for Extensions (GNU Guile) is the preferred extension language system for the GNU Project and features an implementation of the programming language Scheme. Its first version was released in 1993.

GNU Guile — main illustration
GNU Guile — illustration

Key takeaways

  • GNU Guile belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect GNU Guile to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of GNU Guile from memory before moving on to harder problems.

Reference excerpt

GNU Ubiquitous Intelligent Language for Extensions (GNU Guile) is the preferred extension language system for the GNU Project and features an implementation of the programming language Scheme. 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. For extending programs, Guile offers libguile which allows the language to be embedded in other programs, and integrated closely through the C language application programming interface (API); similarly, new data types and subroutines defined through the C API can be made available as extensions to Guile. Guile is used in many programs under the GNU project umbrella (GDB, Make, Guix, GNU TeXmacs, GnuCash, LilyPond but it also sees use outside of that, for example in Google's schism and Lepton-EDA.

Guile Scheme Guile Scheme is a general-purpose, high-level programming language whose flexibility allows expressing 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. Guile implements the Scheme standard R5RS, most of R6RS and R7RS, several Scheme 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." Thus Guile Scheme (and other languages implemented by Guile) can be extended with new data types and subroutines implemented through the C API. The standard distribution offers modules for Portable Operating System Interface (POSIX) system calls, scheduling, a foreign function interface, S-expression based XML processing through SXML, SXPath, and SXSLT, HTTP and other World Wide 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. Its manual suggests using delimited continuations instead, because they have a more efficient implementation. Because foreign code may have pointers to Scheme objects, Guile uses the conservative Boehm–Demers–Weiser (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 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 implementation SCM (which in turn 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 Lord discovered GEL had a naming conflict with another programming language, he solicited suggestions for a new name. From several contributions in several Usenet newsgroups, Lord controversially chose Guile from a suggestion by 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 a flamewar known as the "Tcl War". 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, 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, 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 language Logo. 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. 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. 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.

… excerpt ends here. Continue reading the full article.

Illustrations

GNU Guile illustration

Worked examples

Example 1 — a first encounter with GNU Guile

Start with the simplest possible case. Write down what GNU Guile claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to GNU Guile before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about GNU Guile ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of GNU Guile

In research
GNU Guile appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses GNU Guile in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
GNU Guile is common in secondary-school and first-year university syllabi. It links to neighbouring topics Free and open source interpreters, GNU Project Lisp programming language implementations, Scheme (programming language), so understanding it makes those chapters shorter.
In everyday life
Look for GNU Guile outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “GNU Guile” →

How to study GNU Guile in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what GNU Guile means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain GNU Guile out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is GNU Guile in simple terms?

GNU Ubiquitous Intelligent Language for Extensions (GNU Guile) is the preferred extension language system for the GNU Project and features an implementation of the programming language Scheme. Its first version was released in 1993.

Why does GNU Guile matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study GNU Guile?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on GNU Guile.

Tags

  • Free and open source interpreters
  • GNU Project Lisp programming language implementations
  • Scheme (programming language)
  • Scheme (programming language) implementations
  • Scheme (programming language) interpreters
  • Scripting languages
  • Software using the GPL linking exception

Keep exploring