scheme-script organization created Lassi Kortela (26 Jun 2021 11:15 UTC)
Re: scheme-script organization created Vladimir Nikishkin (26 Jun 2021 11:20 UTC)
Re: scheme-script organization created Lassi Kortela (26 Jun 2021 11:26 UTC)
Re: scheme-script organization created Marc Nieper-Wißkirchen (26 Jun 2021 11:54 UTC)
Re: scheme-script organization created Lassi Kortela (26 Jun 2021 12:03 UTC)
Re: scheme-script organization created Marc Nieper-Wißkirchen (26 Jun 2021 12:18 UTC)
Re: scheme-script organization created Lassi Kortela (26 Jun 2021 12:32 UTC)
Re: scheme-script organization created Marc Nieper-Wißkirchen (26 Jun 2021 12:41 UTC)
Re: scheme-script organization created Lassi Kortela (26 Jun 2021 13:28 UTC)
Re: scheme-script organization created Marc Nieper-Wißkirchen (26 Jun 2021 13:40 UTC)
Re: scheme-script organization created Lassi Kortela (26 Jun 2021 14:16 UTC)
Re: scheme-script organization created Marc Nieper-Wißkirchen (26 Jun 2021 14:30 UTC)
Re: scheme-script organization created Lassi Kortela (26 Jun 2021 14:44 UTC)
Re: scheme-script organization created Marc Nieper-Wißkirchen (26 Jun 2021 15:50 UTC)
Re: scheme-script organization created Marc Feeley (26 Jun 2021 12:42 UTC)
Re: scheme-script organization created Lassi Kortela (26 Jun 2021 12:46 UTC)
Re: scheme-script organization created Marc Nieper-Wißkirchen (26 Jun 2021 13:05 UTC)
Re: scheme-script organization created Lassi Kortela (26 Jun 2021 13:36 UTC)
Re: scheme-script organization created Marc Nieper-Wißkirchen (26 Jun 2021 13:45 UTC)
Re: scheme-script organization created Lassi Kortela (26 Jun 2021 13:58 UTC)
Re: scheme-script organization created Marc Nieper-Wißkirchen (26 Jun 2021 14:20 UTC)
Re: scheme-script organization created Vladimir Nikishkin (26 Jun 2021 14:23 UTC)
Re: scheme-script organization created Marc Nieper-Wißkirchen (26 Jun 2021 14:31 UTC)
Re: scheme-script organization created Marc Nieper-Wißkirchen (26 Jun 2021 13:07 UTC)
Re: scheme-script organization created Marc Nieper-Wißkirchen (26 Jun 2021 19:07 UTC)
Re: scheme-script organization created Lassi Kortela (26 Jun 2021 19:26 UTC)
Re: scheme-script organization created Marc Nieper-Wißkirchen (27 Jun 2021 08:02 UTC)
Re: scheme-script organization created Lassi Kortela (28 Jun 2021 06:47 UTC)
Re: scheme-script organization created Marc Feeley (27 Jun 2021 16:36 UTC)
Re: scheme-script organization created Marc Nieper-Wißkirchen (27 Jun 2021 19:45 UTC)
Re: scheme-script organization created Marc Feeley (27 Jun 2021 21:02 UTC)
Re: scheme-script organization created Marc Nieper-Wißkirchen (28 Jun 2021 06:20 UTC)
Script semantics and declarations Lassi Kortela (28 Jun 2021 06:59 UTC)
Re: Script semantics and declarations Lassi Kortela (28 Jun 2021 07:09 UTC)
Re: Script semantics and declarations Marc Nieper-Wißkirchen (28 Jun 2021 07:20 UTC)
Re: Script semantics and declarations Lassi Kortela (28 Jun 2021 07:49 UTC)
Re: Script semantics and declarations Marc Nieper-Wißkirchen (28 Jun 2021 08:05 UTC)
Re: Script semantics and declarations Lassi Kortela (28 Jun 2021 09:16 UTC)
Re: Script semantics and declarations Marc Nieper-Wißkirchen (28 Jun 2021 09:32 UTC)
Proposed implementation Lassi Kortela (28 Jun 2021 10:28 UTC)
Re: Proposed implementation Marc Nieper-Wißkirchen (28 Jun 2021 12:10 UTC)
Re: Proposed implementation Marc Feeley (28 Jun 2021 12:15 UTC)
Re: Proposed implementation Marc Nieper-Wißkirchen (28 Jun 2021 12:21 UTC)
Re: Script semantics and declarations Marc Nieper-Wißkirchen (28 Jun 2021 20:42 UTC)
Text substitution macros and multi-file archives Lassi Kortela (28 Jun 2021 07:24 UTC)
Re: Text substitution macros and multi-file archives Marc Nieper-Wißkirchen (28 Jun 2021 07:35 UTC)
Re: Text substitution macros and multi-file archives Lassi Kortela (28 Jun 2021 08:07 UTC)
Re: Text substitution macros and multi-file archives Marc Nieper-Wißkirchen (28 Jun 2021 08:23 UTC)
Re: Text substitution macros and multi-file archives Lassi Kortela (28 Jun 2021 08:38 UTC)
Re: Text substitution macros and multi-file archives Marc Nieper-Wißkirchen (28 Jun 2021 08:52 UTC)

Re: Script semantics and declarations Lassi Kortela 28 Jun 2021 07:49 UTC

> The approach used in the file [1] won't go far because the launcher (why
> not using the name `scheme-launch', `lisp-launch' or your `lila' by the
> way?) would have to parse the whole file as s-expressions, which may
> cause it to die on lexical syntax unknown to it.

lila only reads the first 4096 bytes of the file using a lenient
S-expression parser designed to avoid that problem. The parser should
still be tweaked a bit, and a formal spec should be written for it. The
precise number 4096 is up for debate; lila expects a parenthesis-matched
S-expression in that amount of space, and fails if it doesn't find one.

The basic idea is that it reads "..." strings, and () [] {} lists, and
symbol/number-like tokens. This approach works well in practice.

Our Scheme-only launcher can use a stricter parser, but should probably
still be quite conservative, and use something like R3RS or R4RS read
syntax as the baseline.

lila is meant to be a particular implementation of the launcher concept;
writing a spec for (declare-file ...) that can be re-implemented by
others, and also supported natively by Lisp/Scheme implementations that
choose to do so, is the main task.

> So if you want to hand the script file without modifications to a Scheme
> interpreter, the meta-information for the script launcher has to be
> outside the actual s-expressions constituting the program.
>
> I would prefer if the script launcher is allowed to compile the program
> that is finally handed to the actual Scheme interpreter on the fly. This
> allows both more flexibility and a consistent format of the script. It
> also allows to package libraries with the script. It is also needed to
> cope with R6RS.

+1, there's no obvious problem with allowing launcher implementations to
compile programs. Schemes like Guile prefer to compile scripts anyway.

Indeed, Scheme implementations should be permitted to have native
support for reading the declarations, in case people want to use a
particular Scheme only, and want to skip a separate launcher. In that
case the launcher and Scheme are the same program, and it's nonsensical
to argue about who is allowed to compile things.

> Your example [2] is neither a valid R6RS top-level
> program nor a valid R6RS script.

> [2] https://github.com/lispunion/lila/blob/master/examples/hello-r6rs

Thanks, I didn't know that. Can it be rewritten easily as a valid R6
script, keeping (declare-file ...) form (apart from using
#;(declare-file ...) as a datum comment, which the other example does)?