Scheme is a specification, and there are many implementations of it, from small interpreters embedded in other programs to optimising compilers. The reports leave much open, and each implementation adds to the language, so the same .scm file can run on one and fail on another. This page lists the implementations that the site’s other pages refer to and the differences that show in a source file. It was written from memory of the implementations’ own documentation, which was not read (see Not described); it names what is widely known and no more.
The implementations
| Implementation | What it is | Reports and notable features |
|---|---|---|
| Chez Scheme | A compiler to machine code, used by Racket for its newer implementation | R6RS, plus its own extensions in the (chezscheme) library; .sls libraries and .ss source |
| GNU Guile | The GNU project’s extension language, meant to be embedded | R5RS, R6RS and R7RS libraries; keywords #:key, define-module, GOOPS objects, #{...}# symbols, #! … !# comments |
| CHICKEN | A compiler that translates Scheme to C | R5RS and R7RS; extensions called eggs; #> … <# blocks of C, here strings #<<, (declare ...), modules, key: keywords |
| Gambit | A compiler to C, and an interpreter, by Marc Feeley | R4RS, R5RS and R7RS; its own #! objects (#!eof, #!default, #!optional), key: keywords, (##namespace ...), ## primitives, #u8( vectors |
| MIT/GNU Scheme | The implementation that grew out of the work at MIT | R7RS; define-structure, named-lambda, fluid-let, cons-stream, #!optional, 1+ and -1+, syntactic-closure macros, a condition system with restarts |
| Chibi-Scheme | A small R7RS interpreter for embedding, by Alex Shinn (an editor of R7RS-small) | R7RS, .sld libraries |
| Gauche | A scripting implementation by Shiro Kawai | R7RS; define-module, use, generic functions and classes, let1, dotimes |
| Bigloo | A compiler by Manuel Serrano, targeting C, the JVM and .NET | R5RS with a module system; .sch header files |
| Racket | Formerly PLT Scheme; now its own language family with a #lang line, and a library of the same name (racket) | Not Scheme as the reports define it (#lang racket), but a #lang r5rs, #lang r6rs and #lang r7rs are offered; .rkt files. The viewer treats a file with #lang as Racket |
| Larceny, Ikarus, Ypsilon, Sagittarius | R6RS implementations (Sagittarius also R7RS) | .sls libraries |
| Kawa | A Scheme on the JVM | R7RS |
| TinyScheme, s7, STklos, Scheme 48, SCM, SISC | Small and embedded implementations; TinyScheme is the interpreter inside GIMP’s Script-Fu, and s7 is the one used in several audio systems | R5RS-like, with their own extensions |
Dialects, by what shows in a source file
| Feature | Standard Scheme | Variations |
|---|---|---|
| Case | Sensitive in R6RS and R7RS | Folded in R5RS and earlier systems; #!fold-case in R7RS; some implementations choose by file or flag |
| Brackets | ( ); [ ] in R6RS | Chez, Guile, CHICKEN, Gambit, Racket, Larceny and others also accept [ ] as parentheses, and some treat { } as well (SRFI 105 curly infix) |
| Keyword objects | None | #:key (Guile, Racket), key: (Gambit, CHICKEN, SRFI 88), :key (Gauche, SCM and others) |
| Comments | ;, #| |#, #; | #! … !# (Guile), here strings and #>…<# C blocks (CHICKEN) |
| Special objects | #t #f () | #!eof #!default #!unspecific #!optional (MIT, Gambit, Guile); #<unspecified> printed forms |
| Optional parameters | None in the reports | #!optional (MIT/GNU, Gambit), #:optional and #:key with lambda* and define* (Guile), #!optional (CHICKEN), let-optionals (Gauche, SRFI 89) |
| Macros | syntax-rules; syntax-case in R6RS | See Macros |
| Modules | define-library (R7RS), library (R6RS) | See Libraries and modules |
| Hash tables | R6RS (rnrs hashtables) | SRFI 69 and SRFI 125 names (hash-table-ref), Guile’s hash-ref, MIT’s make-equal-hash-table, Gauche’s and CHICKEN’s own |
| String ports and printing | display write | print and printf (CHICKEN, Gauche), pp (pretty-print), format with different directives |
| Conditional compilation | cond-expand | Feature names differ; (declare ...) directives and ## primitives for optimisation (CHICKEN, Gambit) |
The viewer takes in the forms of the table above that it can read (see Lexical structure): the keyword shapes, #! objects and markers, #{ }# symbols, #> C blocks, here strings, #! !# blocks, format directives and the common non-standard syntax names. It does not tell a Guile file from a CHICKEN file, and colours both by the same rules.
Scheme in other programs
- GIMP Script-Fu. Scripts for the GIMP image editor are Scheme files with the extension
.scm, run by an embedded interpreter (TinyScheme in GIMP 2). The scripts define procedures such asscript-fu-registerand use the GIMP procedural database. - Tree-sitter queries. The files
highlights.scm,injections.scm,locals.scmand others in the editors that use the Tree-sitter parser library are written in a language of brackets and@capturesthat looks like Scheme but is not; the viewer names such a file a Tree-sitter query file and shows it without colour. - Festival. The speech synthesis system Festival uses a Scheme-like interpreter (SIOD), and its scripts are
.scmfiles. - Others. Several programs embed a Scheme and name its scripts
.scmor.ss.
Not described
Known, not yet covered
- Reference: every entry in the tables is from memory; none of the implementations’ manuals or websites was read, and the claims about which report each implements, their extensions and the names of their libraries should be checked before use.
- Reference: the implementations that were left out (Scheme 48, Cyclone, Loko, Stalin, Mosh, Foment, Kawa’s details and many others) are not described; the list is not complete.
- Reference: the foreign-function interfaces, the object systems (GOOPS, Gauche’s) and the build tools (CHICKEN’s
chicken-install, Guile’sguild) are not described.
Unknown
- Reference: the claim that Festival’s
.scmscripts use SIOD, and that GIMP 2’s Script-Fu uses TinyScheme, is from memory; the one Festival file found on this Mac, a phonemizer data file, was not checked against the Festival manual.
See also
- Libraries and modules – the module systems
- History and standards – what each report added
- SRFI – the libraries implementations share
- Other Lisps – how Scheme is told from the other Lisp dialects