Re: scheme-script organization created Lassi Kortela 26 Jun 2021 12:32 UTC
> That's irrelevant here; R6RS systems like Chez *do* provide this binary > with the semantic as adviced by the appendix of R6RS. > I don't want to discourage you to do this, quite the contrary. Just > don't use a name that is already used for something more specific. :) > There are plenty of possible names, so there is no need to overload > `scheme-script'. I'm sympathetic to your point, but it's unfortunate if R6RS reserved a generic-sounding name for itself, even if non-normatively. I think we should work hard to recover the name for something forward-compatible while we still can. A scheme-script that runs a specific R6RS implementation is probably used by some site-specific deployments (e.g. many of our Docker containers ship with a scheme-script that runs the Scheme implementation in that container), but I doubt e.g. the APT or Yum package collections have any public package that depends on a scheme-script that runs RnRS. I'd be surprised if even the Guix package collection has such packages. >> I would consider the ability to declare dependencies [...] > > So a script shall be something very different than a top-level programm? IIRC this was discussed on the SRFI lists in 2019 or 2020, and you and I agreed that a script (in the casual sense) naturally corresponds to a "program" in the precise RnRS sense. However, John thought otherwise. If a script file is to declare dependencies in the file itself, it has to have an extension (ideally a non-evaluated S-expression near the beginning of the file) that gives the declarations, and no such S-expression is recognized by RnRS. So the semantics would have to be specified in an SRFI. Assuming we hand-wave away the declaration, using RnRS "program" semantics for the rest of the file seems fine to me, though my memory is fuzzy on the details. For backward compatibility, giving the declaration in a datum comment could be supported. Then a small launcher program could read the declaration and start one of the known compatible and installed Scheme implementations with the right command line flags to run the script. I have a prototype of this.