unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: "Marc Nieper-Wißkirchen" <marc.nieper@gmail.com>
To: John Cowan <cowan@ccil.org>
Cc: Mark H Weaver <mhw@netris.org>, guile-devel@gnu.org
Subject: Re: [PATCH] add SRFI: srfi-121; generators
Date: Tue, 4 Aug 2020 17:58:07 +0200	[thread overview]
Message-ID: <CAEYrNrSiyBct-mveyshzCt5FGOdbvcBO4ABXhvUdGyPeeSYgGw@mail.gmail.com> (raw)
In-Reply-To: <CAD2gp_RC-ARjkS-LNqJxZZNAAV1Lq3m0MRkxHGMdGNorrZ3u5Q@mail.gmail.com>

Am Di., 4. Aug. 2020 um 17:24 Uhr schrieb John Cowan <cowan@ccil.org>:

>>  At the moment,
>> there is no general programmatic way to know whether a specific
>> implementation is up-to-date with respect to these post-finalization
>> notes or not.
>
>
> How could there be?  The implementations are written in a Turing-complete language.

If we had R6RS's library versions, we could just bump the version
number each time the API is changed due to a PFN. (Note that I am not
saying that R6RS's version numbers are the best tool; my point is more
that there are tools.)

>> A similar problem occurs with libraries that have already been voted
>> into R7RS-large. In the Red Edition, (scheme generator) stood for the
>> interface of SRFI 121; in the Tangerine Edition, it stands for SRFI
>> 158.

>
>
> I only did that because 158 is upward compatible with 121; indeed, bug-for-bug compatible, as it turned out.

SRFI 158 is not upward compatible in the full sense with SRFI 121
because it exports more identifiers. Of course, chances that some code
will break are low.

Likewise, SRFI 166, which will most likely replace SRFI 159, is not
fully upward compatible.

That said, these incompatible changes during the draft period of
R7RS-large are the lesser of two evils. As I said, if one needs a more
stable interface, just import (srfi 121) or (srfi 159) instead of
(scheme generator) or (scheme show).

>> While I have been contributing to R7RS-large, I have to agree with you
>> to some extent. Most of the SRFIs that have been voted into R7RS-large
>> or are to be submitted for it don't have the quality of the R6RS or
>> R7RS(-small) specifications

> Inevitably so.  A large granite boulder cannot be cut like a diamond, but it has uses that a diamond does not (and vice versa, of course).

There's already a large granite boulder called Python. When we want to
advertise R7RS-large, which differences shall we point out (apart from
the Lisp syntax)?

>> - Questions of tail context are often ignored.
>> - Higher-order procedures are often silent with respect to call/cc,
>> exceptions or side effects.
>
>
> Regrettably both true.  Scheme is so often used without effects that it's easy to forget they exist.

>> - Formal syntax is often missing.

> What further syntax do you want?  Procedures have only a single syntax, so all we need to know is what arguments exist and in what order.  Macros are few, but informal explanations (as in R[57]RS) seem sufficient to me.

For procedures, we don't need any formal syntax, of course. If it's
needed, it is for macros. If you take a look at many earlier SRFIs,
grammar production rules extending those of R5RS are given, which help
to understand the syntax.

On the other hand if you take a look at many other SRFIs, let's take
SRFI 204 for example, it's hard to know how to implement them just
from reading the spec and not the implementation.

>> - Formal semantics are almost always missing.

> That requires someone who can write their own Greek, which would not be me.

You don't need to write arcane formulas. Take SRFI 2, for example. The
semantics are pretty well laid out.

>> SRFI 121/158 is incidentally also an example for this. Take 'gappend'
>> from SRFI 158, for example. It doesn't specify when the various
>> generator arguments are being called.

> I don't follow you.  It is quite explicit that each is called until it is exhausted in left to right order.

For example, the current spec allows that "gappend" already calls the
various generators supplied as arguments (and stores their results)
before returning the resulting generator. It is specified, in which
order the values are delivered, but it isn't specified when the
supplied generators are asked for their values. There may be an
obvious order of procedure calls, but it is not in the spec.

Thus, if any of the supplied generators has side effects, we will have
an implementation-dependent result. Moreover, we don't know what
happens when the control flow steps out of or into one of the supplied
generator procedures through exceptions or call/cc.

"gappend" was just an example, though. There are many other examples
in many other SRFIs (my own probably as well) where we are not as
precise as R6RS or R7RS. This is somewhat a pity as R7RS-large should
be able to cover that part of R6RS that is not covered by R7RS-small
due to its, well, small size. So it would be great if the quality of
R7RS-large were at least as good as the quality of R6RS.



  reply	other threads:[~2020-08-04 15:58 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.61.1596470427.10776.guile-devel@gnu.org>
2020-08-03 19:41 ` [PATCH] add SRFI: srfi-121; generators Marc Nieper-Wißkirchen
2020-08-04 12:48   ` Marc Nieper-Wißkirchen
2020-08-04 15:24   ` John Cowan
2020-08-04 15:58     ` Marc Nieper-Wißkirchen [this message]
2020-08-04 17:24       ` Dr. Arne Babenhauserheide
2021-01-21 18:39 John Cowan
2021-01-23  0:58 ` Mark H Weaver
2021-01-23  2:14   ` Shiro Kawai
2021-01-23  2:18     ` Arthur A. Gleckler
2021-01-23  6:37       ` Mark H Weaver
2021-01-26  3:29         ` John Cowan
2021-01-26  6:48           ` Linus Björnstam
2021-01-26  6:49             ` Linus Björnstam
2021-01-26  7:14             ` Marc Nieper-Wißkirchen
2021-01-26 11:54               ` Linus Björnstam
2021-04-08 15:53                 ` Arthur A. Gleckler
2021-04-11  6:52                   ` Linus Björnstam
2021-04-11 16:17                     ` Arthur A. Gleckler
  -- strict thread matches above, loose matches on Subject: below --
2020-08-01  3:42 John Cowan
2020-08-02 22:39 ` Mark H Weaver
2019-07-01  0:09 nly
2019-07-01  5:06 ` Mark H Weaver
2019-07-01  6:00   ` Mark H Weaver
2019-07-01  6:21     ` Amar Singh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAEYrNrSiyBct-mveyshzCt5FGOdbvcBO4ABXhvUdGyPeeSYgGw@mail.gmail.com \
    --to=marc.nieper@gmail.com \
    --cc=cowan@ccil.org \
    --cc=guile-devel@gnu.org \
    --cc=mhw@netris.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).