Re: [PATCH] add SRFI: srfi-121; generators
Linus Björnstam 26 Jan 2021 06:48 UTC
Hi Y'all!
I have an efficient, almost done implementation of srfi-121. I believe it lacks generator-unfold, but that is all. make-coroutine-generator is implemented using delimited continuations and runs a lot faster than the one in the reference implementation, with the caveat that it is apparently slightly incompatible: the coroutine generator usage in (srfi 146 hash) yielded the wrong result - despite my version passing all tests.
If the maintainers of guile are interested, I could clean this code up and add accumulators and make sure it conforms to the srfi document.
I have already spent some time integrating srfi-171 into guile, so I'm not entirely unfamiliar with the task.
Best regards
Linus Björnstam
On Tue, 26 Jan 2021, at 04:29, John Cowan wrote:
> Note that 121 is withdrawn, so people should implement 158.
>
> On Sat, Jan 23, 2021 at 1:38 AM Mark H Weaver <xxxxxx@netris.org> wrote:
> > Hi Arthur,
> >
> > "Arthur A. Gleckler" <xxxxxx@speechcode.com> writes:
> > > It's not a bad idea for the sample implementation to be as clear as
> > > possible at the expense of performance.
> >
> > I agree that it's desirable for one of the sample implementations to be
> > as simple and clear as possible, for the purpose of clarifying the
> > specification.
> >
> > > But it certainly wouldn't hurt to have a supplemental document making
> > > recommendations about possible performance improvements, or even a
> > > second implementation.
> >
> > Sounds good. For SRFIs such as 121 and 158, where efficiency is
> > important, I think that a second sample implementation tuned for
> > performance would be a useful addition.
> >
> > Regards,
> > Mark