[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Add preliminary versions of the R7RS libraries along with do

From: Freja Nordsiek
Subject: Re: [PATCH] Add preliminary versions of the R7RS libraries along with documentation and tests
Date: Sat, 17 Jun 2017 02:02:52 +0200

I was able to add the unit tests I had written to the r7rs-wip branch
and run them (patch is attached). The things that they tested mostly
worked out of the box, which is a good sign. Had to fix a couple
errors in some of the tests (checked the R7RS-small standard and my
tests were indeed in error).

Also, I found one error in the get-output-bytevector procedure in
(scheme base), which was that the procedure discarded the bytes
already written. get-output-bytevector is not supposed to be
destructive to the bytes already written, but the R6RS output
bytevector reading procedures are destructive. I made a patch with a
very simple fix, which is to just write the bytes back. It has one
major problem, though, and that is it is not threadsafe, so while it
is an improvement, there is still some more work to do on it.

Next thing I am going to do is copy over the docstrings I wrote for
code going to the bitbucket (my versions of the r7rs modules) to the
ones already in r7rs-wip since they are lacking docstrings.

Freja Nordsiek

On Tue, May 30, 2017 at 12:02 AM, Mark H Weaver <address@hidden> wrote:
> Hi Freja,
> Freja Nordsiek <address@hidden> writes:
>> As far as splitting it into parts and discarding the scheme modules
>> and keeping the documentation, that sounds like a good idea. I just
>> did a quick perusal of the r7rs-wip branch and it does not seem to
>> have any R7RS unit tests. Did I miss any? If not, the test code, as
>> limited as it is, might also be useful.
> You didn't miss any.  I agree that we need a good R7RS test suite.  The
> tests you wrote could be a useful starting point, but clearly more
> coverage is needed.
> Some existing free R7RS Scheme implementations include test suites that
> we might be able to incorporate.  Chibi Scheme includes one which I
> found useful while developing 'r7rs-wip', and as I vaguely recall there
> were at least two others.  Kawa might have one.
> I think we should aim to adapt and incorporate one or more existing R7RS
> test suites from elsewhere, if the relevant licenses are favorable.
>> As for the question/puzzlement of why I wrote all of this, that is
>> complicated, and kind of silly in retrospect. The r7rs-wip branch
>> looked like it was most of the way to complete but was three years
>> behind the master branch and thus seemed like it was possibly dead for
>> unknown reasons [...]
>> Honestly, I should have just emailed the
>> list and what not and asked about the status of the r7rs-wip branch
>> and why it stalled, and then go from there (e.g. write the
>> documentation and possibly tests). I ended up duplicating a lot of
>> effort in a sloppy way.
> I can understand this.  Unnecessarily rewriting code seems to be a
> common tendency in our community, and I confess that I've been known to
> do it myself.  Hopefully the work had some educational value at least.
> I would guess that the overwhelming majority of the new Scheme code in
> 'r7rs-wip' does not depend on the C changes.
> I stalled on the 'r7rs-wip' work for a few reasons.  For a couple of
> years, I had doubts about whether the R7RS should be promoted at all,
> given that it is gratuitously incompatible with the R6RS, which I
> consider to be more competently designed even though I disagree with
> some aspects of R6RS.
> Apart from that, I encountered difficulties implementing
> cyclic-data-aware R7RS 'write' and 'write-shared' in a way that's
> efficient, compatible with existing APIs (custom printers, print states,
> etc), and not too gross.  I have an idea how to fix those issues, but
> haven't gotten around to implementing it yet.
> There are some details that are not yet addressed, e.g. supporting
> integers as components of module names, and deciding how to implement
> (library <library-name>) clauses in 'cond-expand'.
> Finally, the lack of a comprehensive test suite made me concerned that
> the code was not adequately tested.
>> I will split the documentation and possibly the tests out into their
>> own patches and modify them to work with r7rs-wip branch instead of
>> master branch.
> Thank you for your efforts!
>        Mark

Attachment: 0001-Added-initial-tests-for-R7RS-small.patch
Description: Text Data

Attachment: 0001-Fixed-get-output-bytevector-discarding-already-writt.patch
Description: Text Data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]