Re: Scheme filename extensions
Lassi Kortela 27 May 2020 10:30 UTC
> The extension should reflect the contents of the file.
>
> .scm is for Scheme code. define-library is not Scheme code, though
> sometimes Scheme code is nested inside it.
> .sld is for Scheme Library Definitions. For some impls, this is just a
> static define-library. For Chibi, it is a full fledged language
> distinct from Scheme.
>
> If you are proposing some metadata format which is not Scheme code,
> neither of the above extensions would be appropriate.
If extensions are desired, perhaps we could have two-level extensions:
* .scm
* .lib.scm
* .data.scm
* .meta.scm
* ...
That would be easier to read than the three-letter acronyms.
Some R6RS packages are already using filenames like these:
* .ikarus.sls
* .chezscheme.sls
Some countries' domain names use a similar system: .co.uk and such.
In any case, I would prefer that library lookup be
extension-independent. If the library directory has a metadata under a
known name, that file could say which extensions mean what.
I have a feeling that agreeing on common extensions for existing Scheme
codebases won't be easy :) That's part of what fuels the proposal for a
metadata file. Another is the R6RS filename mapping mess (filenames like
"lib/srfi/%3a145.nmosh.sls" and its variants).