What is the correct schema file extension?

Programming language schema files are conditional either for the .scm or .ss .

I am interested in what the history of these extensions is, and also in their proper use, although it seems that the universal attitude is that this is all that you prefer, and it does not matter, but maybe I'm wrong about that.

+13
source share
2 answers

There is no proper Schema extension. I looked at R [567] RS and is not specified.

This is intentional because Appendix F in the R6RS non-normative application project (PDF) is actually related to mapping from the library path to a file path that did not make the final specification.

The most common file extension for Scheme programs is .scm , and other extensions for developers have been added to R6RS and possibly R7RS to distinguish the library from the main programs.

In fact, the only thing you need to make sure of the implementation is that there is a way to β€œinstall” the library, and this is usually a file that needs to be mapped to the library name in the source code. On Racket R6RS, this is done by the installer:

 plt-r6rs --install test.xxx [installing /home/westerp/.racket/6.4/collects/examples/hello.ss] [Compiling /home/westerp/.racket/6.4/collects/examples/hello.ss] 

Thus, in fact, for racket, it accepts any file name / extension without any questions, but uses .ss as an extension for R6RS and looks for .sls and .scm , and also you must manually do what plt-r6rs --install does manually.

In other implementations, manual methods of installing the library may be required, but it still has nothing to do with the schema language, since the specification left this part outside its implementation.

+13
source

Here is a list of all the Scheme-related name extensions I came across. After each extension, there is an assumption about its extension in quotation marks. If any information is incorrect or missing, please comment.

General Schema Extensions

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

.sps ("Scheme Program Source") - R6RS Scheme Program. As far as I can tell, it is not much different from .scm , but I think this extension means that the file contains the main program and, therefore, its name can be passed to the Scheme interpreter to start the program.

.sls ("Schema library source") is a form of R6RS (library...) which contains both interface declarations and library implementations. You will find them in Akku bags, for example.

.sld ("Definition of the library of schemes") - form R7RS (define-library...) . This form contains declarations only. It uses (include...) to include the actual source .scm library files. You will be in Snow packages, for example.

Extensions for Scheme-derived languages

.rkt ("Racket") - the source code of the racket. Racket supports R6RS Scheme, R7RS Scheme (via a third-party package), its own dialect (also called Racket), which has now expanded slightly from R6RS, and quite a few languages ​​that have little to do with Scheme. Each .rkt file starts with a line like #lang racket/base so that .rkt in what language.

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

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

Rare Schema Extensions

.ss ("Schema Source") - A rare equivalent of .scm . Please prefer .scm .

.sc ("Schema") - A rare equivalent of .scm . Please prefer .scm .

0
source

All Articles