Vocabulary for finding libraries Lassi Kortela (26 Oct 2022 18:17 UTC)
Re: Vocabulary for finding libraries Arthur A. Gleckler (26 Oct 2022 19:03 UTC)
Re: Vocabulary for finding libraries Lassi Kortela (26 Oct 2022 20:43 UTC)
Re: Vocabulary for finding libraries Lassi Kortela (26 Oct 2022 21:07 UTC)
Re: Vocabulary for finding libraries Lassi Kortela (26 Oct 2022 21:40 UTC)

Vocabulary for finding libraries Lassi Kortela 26 Oct 2022 18:17 UTC

To illustrate what I've been talking about, here's a brief sketch of
what a domain-specific language to find libraries could look like.

This is heavily influenced by the Unix filesystem (i.e. a uniform tree
where you can mount subtrees in arbitrary places) as well as the kind of
combinator DSLs that are standard in functional programming.

Example:

(library-path
  (union
   (at srfi
       (union (directory "/usr/lib/gambit/srfi")
              (git-repos
"github.com/scheme-requests-for-implementation/srfi-$")))
   (at my-favorites
       (union (at lists (alias (srfi 1)))
              (at strings (alias (srfi 13)))))
   (at gambit
       (union (directory "/usr/lib/gambit/gambit")
              (git-repos "github.com/gambit/$")))
   (using-convention ".sld" (directory ".")))

Where (library-path <node>) sets the search path, and <node> is one of:

(library "/path/to/file")

     This node points to the library in this file.

(directory "/path/to/directory")

     Splice all names from this directory here.

(archive "/path/to/archive.tar")

     Splice all names from this archive here.

(git-repos "example.com/path/to/repo-name-$")

     Names here are substituted as $ in the URL template to get a URL
     where we can find a git repo. Second-level and deeper names are
     files in the repo.

(at <library-name-part> <node>)

     Make a virtual subdirectory here named <library-name-part>
     containing all names from <node>.

(union <node> ...)

     Splice all names from the given nodes here. If the same name
     exists in more than one node, the first node wins. In other words,
     the <node>s are listed in decreasing order of precedence.

(alias <library-name>)

     Like a Unix symbolic link, points to an absolute library name.

(using-convention <convention> <node>)

     Use <node>, but always use a particular <convention> to find
     library files in it. There should be an implementation-defined
     default convention otherwise.