CINXE.COM

GNU's programming and extension language — GNU Guile

<html lang="en"><head><title>GNU's programming and extension language — GNU Guile</title><meta charset="UTF-8" /><meta name="author" content="GNU Guile contributors" /><meta name="keywords" content="GNU, Guile, Scheme, Computing, Computer Science, Free Software, Libre Software, Free Cultural Works, Games, Programming, Programming language, Extension language, Scheme" /><meta name="description" content=" Guile is the GNU Ubiquitous Intelligent Language for Extensions, the official extension language for the GNU operating system." /><meta name="viewport" content="width=device-width, initial-scale=1.0" /><link rel="stylesheet" href="/software/guile/static/base/css/base.css" /><link rel="stylesheet" href="/software/guile/static/base/css/index.css" /><link rel="icon" type="image/png" href="/software/guile/static/base/img/favicon.png" /></head><body><header id="site-menu"><h1><a id="branding" href="/software/guile/"><span>GNU Guile</span></a></h1><nav id="pages-box"><h2>Menu: </h2><a class="page-link" href="/software/guile/download/">Download </a><a class="page-link" href="/software/guile/learn/">Learn </a><a class="page-link" href="/software/guile/libraries/">Libraries </a><a class="page-link" href="/software/guile/contribute/">Contribute </a><a class="page-link page-link-active" href="/software/guile/">About</a></nav></header><main><section id="featured-box" class="info-box text-left"><div><h2>Guile is a programming language</h2><img class="responsive-image centered-block" src="/software/guile/static/base/img/kid-programming-a-robot.png" alt="" /><p>Guile is designed to help programmers create flexible applications that can be extended by users or other programmers with plug-ins, modules, or scripts.</p><p>With Guile you can create applications and games for the <a href="#apps-using-guile">desktop</a>, the <a href="#apps-using-guile">Web</a>, the <a href="#apps-using-guile">command-line</a>, and more.</p><p class="button-box"><a class="red-button" href="/software/guile/download/">Download</a> <a class="red-outline-button" href="/software/guile/learn/">Get started</a></p></div></section><section id="code-examples" class="free-flow-box gears-bg"><h2>Code examples</h2><p>Guile is an implementation of the <a href="http://schemers.org/">Scheme</a> programming language, supporting the <a href="http://www.schemers.org/Documents/Standards/R5RS/">Revised<sup>5</sup></a> and most of the <a href="http://www.r6rs.org/">Revised<sup>6</sup></a> language reports, as well as many <a href="http://srfi.schemers.org/">SRFIs</a>. It also comes with a library of modules that offer additional features, like an HTTP server and client, XML parsing, and object-oriented programming.</p><section class="code-example"><pre class="code"><span class="comment single">;;; Hello world program</span> <span class="punctuation">(</span><span class="keyword">define </span><span class="name variable">name</span> <span class="literal string">&quot;World&quot;</span><span class="punctuation">)</span> <span class="punctuation">(</span><span class="name builtin">display </span><span class="punctuation">(</span><span class="name builtin">string-append </span><span class="literal string">&quot;Hello &quot;</span> <span class="name variable">name</span> <span class="literal string">&quot;!&quot;</span><span class="punctuation">))</span> <span class="punctuation">(</span><span class="name function">newline</span><span class="punctuation">)</span></pre><h3>Hello world program</h3><p><a href="/software/guile/manual/html_node/Definition.html">Define a variable</a> called <code>name</code>, join the texts <code>Hello</code>, <code>name</code>, and <code>!</code> together to form the greeting <code>Hello world!</code>, and display it on the screen.</p></section><section class="code-example"><pre class="code"><span class="comment single">;;; Show current date and time</span> <span class="punctuation">(</span><span class="name function">use-modules</span> <span class="punctuation">(</span><span class="name function">srfi</span> <span class="name variable">srfi-19</span><span class="punctuation">))</span> <span class="punctuation">(</span><span class="name builtin">display </span><span class="punctuation">(</span><span class="name function">date-&gt;string</span> <span class="punctuation">(</span><span class="name function">current-date</span><span class="punctuation">)</span> <span class="literal string">&quot;~A, ~B ~e ~Y ~H:~S&quot;</span><span class="punctuation">))</span> <span class="punctuation">(</span><span class="name function">newline</span><span class="punctuation">)</span></pre><h3>Importing modules</h3><p><a href="/software/guile/manual/html_node/Modules.html">Import</a> the <a href="/software/guile/manual/html_node/SRFI_002d19.html">srfi-19 module</a> and use its functions to display the current date and time in the format WEEKDAY, MONTH MONTHDAY YEAR HOUR:SECOND.</p></section><section class="code-example"><pre class="code"><span class="comment single">;;; Hello HTTP server</span> <span class="punctuation">(</span><span class="name function">use-modules</span> <span class="punctuation">(</span><span class="name function">web</span> <span class="name variable">server</span><span class="punctuation">))</span> <span class="punctuation">(</span><span class="keyword">define </span><span class="punctuation">(</span><span class="name function">my-handler</span> <span class="name variable">request</span> <span class="name variable">request-body</span><span class="punctuation">)</span> <span class="punctuation">(</span><span class="name builtin">values </span><span class="operator">'</span><span class="punctuation">((</span><span class="name function">content-type</span> <span class="operator">.</span> <span class="punctuation">(</span><span class="name function">text/plain</span><span class="punctuation">)))</span> <span class="literal string">&quot;Hello World!&quot;</span><span class="punctuation">))</span> <span class="punctuation">(</span><span class="name function">run-server</span> <span class="name variable">my-handler</span><span class="punctuation">)</span></pre><h3>Hello HTTP server</h3><p>Run a <a href="/software/guile/manual/html_node/Web-Server.html">Web server</a> that will return a response with the text &quot;Hello World!&quot; to every request sent by HTTP clients. Open <tt>http://localhost:8080/</tt> to see the result.</p></section></section><section class="info-box text-right"><div><h2>Guile is an extension language platform</h2><img class="responsive-image centered-block" src="/software/guile/static/base/img/kid-robot-and-extension-legs.png" alt="" /><p>Guile contains an efficient compiler and virtual machine. It can be used out of the box to write programs in Scheme, or can easily be integrated with C and C++ programs.</p><p>Guile is the GNU Ubiquitous Intelligent Language for Extensions, and the official extension language of the <a href="http://gnu.org/">GNU project</a>.</p></div></section><section class="info-box text-left"><div><h2>Extend applications</h2><img class="responsive-image centered-block" src="/software/guile/static/base/img/robots-and-extension-legs-1.png" alt="" /><p>In addition to Scheme, Guile includes compiler front-ends for <a href="http://www.ecma-international.org/publications/standards/Ecma-262.htm">ECMAScript</a> and <a href="http://www.emacswiki.org/cgi-bin/wiki?EmacsLisp">Emacs Lisp</a> (support is underway for <a href="http://www.lua.org/">Lua</a>), which means your application may be extended in the language (or languages) most appropriate for your user base. And Guile's tools for parsing and compiling are exposed as part of its standard module set, so support for additional languages can be added without writing a single line of C.</p></div></section><section class="info-box text-right"><div><h2>Guile empowers users with &quot;practical software freedom&quot;</h2><img class="responsive-image centered-block" src="/software/guile/static/base/img/kid-flying-robots.png" alt="" /><p>Using any of the supported scripting languages, users can customize and extend applications while they are running and see the changes take place live!</p><p>Users can easily trade and share features by uploading and downloading the scripts, instead of trading complex patches and recompiling their applications.</p><p class="button-box"><a class="red-outline-button" href="/software/guile/learn/">Read more</a></p></div></section><section id="apps-using-guile" class="free-flow-box noise-bg"><h2>Applications using Guile</h2><a class="app-example" href="https://guix.gnu.org/"><img src="/software/guile/static/base/img/apps-thumbnails/guixsd.png" alt="" /><h3>GNU Guix</h3><p>Package manager and GNU distribution</p></a><a class="app-example" href="http://gnucash.org/"><img src="/software/guile/static/base/img/apps-thumbnails/gnucash.png" alt="" /><h3>GnuCash</h3><p>Accounting software</p></a><a class="app-example" href="https://github.com/lepton-eda/"><img src="/software/guile/static/base/img/apps-thumbnails/geda.png" alt="" /><h3>Lepton-EDA</h3><p>Suite for Electronic Design Automation</p></a><a class="app-example" href="https://www.gnu.org/software/gdb/"><img src="/software/guile/static/base/img/apps-thumbnails/gdb.png" alt="" /><h3>GDB</h3><p>The GNU debugger</p></a></section><section id="news" class="free-flow-box"><h2>News</h2><a href="/software/guile/news/gnu-guile-3010-released.html" class="news-item"><h4>GNU Guile 3.0.10 released</h4><p class="news-date">June 24, 2024</p><p class="news-summary">We are pleased to finally announce the release of GNU Guile 3.0.10! This release is mainly a bug-fix release, though it does include a number of new features:Better ability…</p></a><a href="/software/guile/news/gnu-guile-309-released.html" class="news-item"><h4>GNU Guile 3.0.9 released</h4><p class="news-date">January 25, 2023</p><p class="news-summary">We are pleased to announce the release of GNU Guile 3.0.9! This release fixes a number of bugs and adds several new features, among which:New bindings for POSIX functionality,…</p></a><a href="/software/guile/news/gnu-guile-308-released.html" class="news-item"><h4>GNU Guile 3.0.8 released</h4><p class="news-date">February 11, 2022</p><p class="news-summary">We are delighted to announce the release of GNU Guile 3.0.8. This release adds support for cross-module inlining: allowing small functions and constants defined in one module…</p></a><p class="button-box"><a class="red-outline-button" href="/software/guile/news">More news</a></p></section></main><footer class="site-footer noise-bg"><div><h2>About this website</h2><p>This website is powered by GNU Guile and the <a href="http://git.savannah.gnu.org/cgit/guile/guile-web.git">source code</a> is under the <a href="http://www.gnu.org/licenses/agpl-3.0.html">GNU AGPL</a>.</p><p>Please use the <a href="https://lists.gnu.org/mailman/listinfo/guile-user/">mailing list</a> or the <a href="https://kiwiirc.com/nextclient/irc.libera.chat/?nick=guile-guest#guile">#guile</a> channel on the Libera IRC network for more information about GNU Guile and this website.</p></div><section><h3>Guile</h3><ul><li><a href="/software/guile/">Home</a></li><li><a href="/software/guile/download/">Download</a></li><li><a href="/software/guile/learn/">Learn</a></li><li><a href="/software/guile/libraries/">Libraries</a></li><li><a href="https://savannah.gnu.org/news/?group=guile">News</a></li><li><a href="https://kiwiirc.com/nextclient/irc.libera.chat/?nick=guile-guest#guile">Community</a></li><li><a href="/software/guile/contribute/">Contribute</a></li></ul></section><section><h3>Learn</h3><ul><li><a href="/software/guile/learn/#tutorials">Tutorials</a></li><li><a href="/software/guile/learn/#manuals">Reference manuals</a></li><li><a href="/software/guile/learn/#scheme-resources">Scheme resources</a></li><li><a href="/software/guile/learn/#bibliography">Suggested bibliography</a></li></ul></section><section><h3>Libraries</h3><ul><li><a href="/software/guile/libraries/#core">Core</a></li><li><a href="/software/guile/libraries/#gui">GUI</a></li><li><a href="/software/guile/libraries/#file-formats">File formats</a></li><li><a href="/software/guile/libraries/#networking">Networking</a></li><li><a href="/software/guile/libraries/#tools">Tools</a></li><li><a href="/software/guile/libraries/#apps">Applications</a></li></ul></section><section><h3>Contribute</h3><ul><li><a href="/software/guile/contribute/">Project summary</a></li><li><a href="/software/guile/contribute/#bugs">Report bugs</a></li><li><a href="https://savannah.gnu.org/git/?group=guile">Source code</a></li></ul></section></footer></body></html>

Pages: 1 2 3 4 5 6 7 8 9 10