Guile

by Daniel Pimentel — Tue 04 April 2006

Guile is an implementation of the Scheme programming language. Scheme (http://schemers.org/) is an elegant and conceptually simple dialect of Lisp, originated by Guy Steele and Gerald Sussman, and since evolved by the series of reports known as RnRS (the Revised^n Reports on Scheme).

Features

  • it is easy to combine with other code written in C
  • it has a historical and continuing connection with the GNU Project
  • it emphasizes interactive and incremental programming
  • it actually supports several languages, not just Scheme.

Running Guile Interactively

$ guile
scheme@(guile-user)> (+ 1 2 3) ; add some numbers
$1 = 6
scheme@(guile-user)> (define (factorial n) ; define a function
                       (if (zero? n) 1 (* n (factorial (- n 1)))))
scheme@(guile-user)> (factorial 20)
$2 = 2432902008176640000
scheme@(guile-user)> (getpwnam "root") ; look in /etc/passwd
$3 = #("root" "x" 0 0 "root" "/root" "/bin/bash")
scheme@(guile-user)> C-d
$

Running Guile Scripts

#!~.guix-profile/bin/guile -s
!#
(display "Hello, world!")
(newline)
GNU Guile
2000-2016 by Daniel Pimentel under GFDL