LinuxCommandLibrary

guile

Execute Scheme code

TLDR

Start a REPL (interactive shell)

$ guile
copy

Execute the script in a given Scheme file
$ guile [script.scm]
copy

Execute a Scheme expression
$ guile -c "[expression]"
copy

Listen on a port or a Unix domain socket (the default is port 37146) for remote REPL connections
$ guile --listen=[port_or_socket]
copy

SYNOPSIS

guile [OPTION]... [SCRIPT [ARGUMENT]...]

PARAMETERS

-c EXPR
    Evaluate EXPR as a Scheme expression and exit.

-s SCRIPT
    Load and run the specified SCRIPT file. Subsequent arguments are passed to the script.

-l FILE
    Load the Scheme source FILE before evaluating any further expressions or scripts.

-L DIRECTORY
    Add DIRECTORY to the module and extension load path, allowing Guile to find libraries.

--debug
    Enable debugging features for Guile programs, useful for tracing and breakpoints.

--version
    Display Guile's version information and exit.

--help
    Display a summary of command-line options and exit.

--interactive
    Enter an interactive read-eval-print loop (REPL) after processing all other command-line arguments.

DESCRIPTION

guile is the GNU Project's official extension language. It is a robust and flexible implementation of the Scheme programming language, a powerful dialect of Lisp. Designed primarily for embedding into applications written in C, C++, and other languages, Guile provides a seamless way to add scripting, configuration, and extensibility capabilities to software. It adheres to various Scheme standards (R5RS, R6RS, R7RS) and offers a rich set of features including modules, continuations, threads, and dynamic linking. Beyond its embedding role, guile also functions as a standalone interpreter for general-purpose scripting, rapid prototyping, and developing full-fledged applications, leveraging its extensive standard library and powerful JIT compiler.

CAVEATS

While powerful, Guile's full potential often comes from its integration as an embedded language, which requires developers to interact with its C API. The performance characteristics of interpreted or JIT-compiled Scheme code can vary based on the workload. Compatibility with every nuance of various Scheme standards (R5RS, R6RS, R7RS) might not be 100% complete across all features, though it strives for high adherence. Users should consult the official Guile documentation for detailed information on specific standard compliance and embedding guidelines.

ENVIRONMENT VARIABLES

Guile's behavior can be influenced by environment variables. Key ones include GUILE_LOAD_PATH, which specifies directories where Guile searches for Scheme source files and modules, and GUILE_EXTENSIONS_PATH, used for locating C extensions that Guile can load dynamically.

EMBEDDING CAPABILITIES

While guile runs as a standalone interpreter, its primary design strength lies in its robust embedding capabilities. Developers can link the Guile library into their C/C++ applications, exposing Scheme as a powerful, high-level extension language. This allows end-users to customize, script, and extend applications using Guile, fostering a highly flexible and adaptable software ecosystem.

HISTORY

Guile was initiated by the GNU Project in 1993, with Richard Stallman envisioning a single, universal extension language for GNU software, moving away from fragmented domain-specific languages like Emacs Lisp or Tcl. Scheme was chosen for its clean semantics, extensibility, and small core. Development has been continuous, with significant milestones including the introduction of a new compiler and JIT in Guile 2.0 (2009), further JIT improvements in 2.2 and 3.0 (2019). Guile has become a core component of the GNU system, serving as the extension language for applications like GnuCash, GNU TeXmacs, and parts of the GNU Build System, reinforcing its role as GNU's 'Ubiquitous Intelligent Language for Extensions'.

SEE ALSO

scheme(1), gosh(1), chicken(1), clisp(1), racket(1), emacs(1)

Copied to clipboard