What's the proper scheme file extension?

Viewed 17858

Files of the programming language Scheme are by convention either of the extension .scm or .ss.

I'm interested in what the history of these extensions is, and also in the proper use, though it seems the universal attitude is that it's just whatever you prefer and it doesn't matter, but maybe I'm wrong about that.

2 Answers

Here's a list of all the Scheme-related file name extensions I've encountered. After each extension is a guess of its expansion in quotes. If some information is wrong or missing, please comment.

Common extensions for Scheme

.scm ("Scheme") -- Scheme source code written for R5RS, R6RS, R7RS, or any other implementation and standard. This is the most common and generally preferred extension for Scheme source files.

.sps ("Scheme program source") -- A R6RS Scheme program. Not really different from .scm as far as I can tell, but I guess this extension signifies that the file contains a main program and hence its name can be passed to a Scheme interpreter to run the program.

.sls ("Scheme library source") -- A R6RS (library ...) form which contains both interface declarations and the library implementation. You'll find these in Akku packages, for example.

.sld ("Scheme library definition") -- A R7RS (define-library ...) form. That form tends to contain mostly declarations, using (include ...) to include the actual .scm source files of the library. You'll these in Snow packages, for example.

Extensions for Scheme-derived languages

.rkt ("Racket") -- Racket source code. Racket supports R6RS Scheme, R7RS Scheme (through a third-party package), its own dialect (also called Racket) which has now expanded quite a bit from R6RS, and quite a few languages that have little or nothing to do with Scheme. Each .rkt file starts with a line like #lang racket/base to say which language that file is written in.

.scr ("Scribe") -- A text document written in Scheme Scribe, a markup language similar in spirit to TeX/LaTeX but with Scheme as the macro language. Note: The original Scribe markup language from 1980 did not use Scheme.

.scrbl("Scribble") -- A text document written in Scribble, a modern version of Scheme Scribe. Scribble interpreters have been implemented for at least Racket and Chibi Scheme.

Rare extensions for Scheme

.ss ("Scheme source") -- Rare equivalent to .scm. Spotted in the source code of some R6RS implementations.

.sc ("Scheme") -- Rare equivalent to .scm.

.sch ("Scheme") -- Spotted in the source code of the Larceny implementation.

.sps7 ("Scheme program source (R7RS)") -- A R7RS Scheme program. Spotted in the source code of the Larceny implementation.

Related