Am So., 25. Apr. 2021 um 17:45 Uhr schrieb Lassi Kortela <xxxxxx@lassi.io>:
> I don't want this to become part of the R[67]RS Scheme library system
> syntax, nor do I think that this would be needed. (But maybe I
> misunderstand you here.)
>
> It's the purpose of the package manager to install the libraries in such
> a way that I can just do "(import (foo qux))". And if I distribute my
> program as a package, I would add
> "git://xxxxxx@github.com:account/repo.git" as a dependency.
>
> Packages should be fine-grained enough that I don't have to select
> certain libraries from a package. E.g., there may be a package called
> r7rs-large, but this should be a meta-package consisting of packages
> scheme-box, scheme-ilist, scheme-xxx, ....

So a package is a library collection, and library collections can nest.
It follows that it can makes sense to take any given collection at any
level in the hierarchy and do something with it. And a library is a
theoretically a singleton package.

A package is more than a library collection. It would include test code. It would include meta-information. It could even include executable scripts that are used to actually generate the libraries on the target system. In general, it doesn't make sense just to grab some subtree of the library collection.
 

>     If the library can list its own dependencies, it would make perfect
>     sense to find only one. The package manager can chase the dependencies
>     for the user.
>
> I'm not sure I understand what you mean here.

For the purposes of this line of reasoning, think of the library as an
implicit single-library package.

There could be a simple tool converting a single library into such a package.
 
I think the main dividing line between package and library is that
libraries represent _code_, packages represent _authority_. A package
says where you can get some code, and that implies how to traverse
files, directories, and networks; how to log in using credentials, etc.

A library doesn't imply any of that stuff; if you get equivalent code
some other way (e.g. using a known hash to download it from IPFS) it's
just as good.

>     Are you thinking of something like the rewrite rule above?
>
> I haven't fully thought about it because I don' think that it should be
> used (much).

Rewriting could solve all of these problems in one system:

I didn't mean that rewriting shouldn't be used but that the default mapping isn't that useful IMO.
 
- The .scm vs .import.scm vs .sls vs .sld ... file extension wars.

- The %-encoding of filenames for R6RS libraries.

- The R6RS numbers-in-library-names thing.

- Case folding in filenames.

- Reading Scheme libraries from zip/tar files.

- Reading files from URLs vs local computer.

- Reading from git and directories.

I would call this "compiling" and not "rewriting" because it may involve even more.