Bigloo SRFI 158: Generators and Accumulators

Joseph Donaldson <[email protected]> Sat, 9 Mar 2024 18:20:43 +0000 (UTC)
Newsgroups gmane.lisp.scheme.bigloo
Message-ID <[email protected]>
------=_Part_2506951_1385129381.1710008443165
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Hello,=20

I have adapted SRFI 158: Generators and Accumulators for Bigloo. It can be =
found at https://github.com/donaldsonjw/srfi158. Both the Bigloo native and=
 jvm backends are supported. The SRFI 158 library requires coroutines, and =
the sample implementation, unsurprisingly, leverages call/cc for its implem=
entation. Unfortunately, Bigloo=E2=80=99s support for call/cc is poor, so t=
his library instead provides 2 different, non call/cc-based coroutine imple=
mentations. The native backend implements coroutines via the makecontext fa=
mily of procedures, and the jvm backend uses a thread-based implementation.=
 I am certain there are still some rough edges and would appreciate any fee=
dback, if someone gives it a try.
N.B., I have only tested the make-context corroutine implementation on X86-=
64 Linux, and given that the performance difference, at least in my limited=
 and non-scientific benchmarking, does not seem to be too great, I am consi=
dering just supporting the thread-based implementation for both the native =
and jvm backends.
Thank You,Joseph Donaldson=20








------=_Part_2506951_1385129381.1710008443165
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<html><head></head><body><div class=3D"yahoo-style-wrap" style=3D"font-fami=
ly:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:13px;"><div dir=
=3D"ltr" data-setdir=3D"false">Hello, <br></div><div dir=3D"ltr" data-setdi=
r=3D"false"><br></div><div dir=3D"ltr" data-setdir=3D"false">I have adapted=
 SRFI 158: Generators and Accumulators for Bigloo. It can be found at <a hr=
ef=3D"https://github.com/donaldsonjw/srfi158" rel=3D"nofollow" target=3D"_b=
lank" class=3D"">https://github.com/donaldsonjw/srfi158</a>. <span>Both the=
 Bigloo native and jvm backends are supported. The SRFI 158=20
library requires coroutines, and the sample implementation,=20
unsurprisingly, leverages call/cc for its implementation. Unfortunately,
 Bigloo=E2=80=99s support for call/cc is poor, so this library instead prov=
ides 2
 different, non call/cc-based coroutine implementations. The native=20
backend implements coroutines via the <a href=3D"https://www.man7.org/linux=
/man-pages/man3/makecontext.3.html" rel=3D"nofollow" target=3D"_blank" clas=
s=3D"">makecontext</a> family of procedures, and the jvm backend uses a thr=
ead-based implementation. I am certain there are still some rough edges and=
 would appreciate any feedback, if someone gives it a try.</span></div><div=
 dir=3D"ltr" data-setdir=3D"false"><span><br></span></div><div dir=3D"ltr" =
data-setdir=3D"false"><span>N.B., I have only tested the make-context corro=
utine implementation on X86-64 Linux, and given that the performance differ=
ence, at least in my limited and non-scientific benchmarking, does not seem=
 to be too great, I am considering just supporting the thread-based impleme=
ntation for both the native and jvm backends.</span></div><div dir=3D"ltr" =
data-setdir=3D"false"><span><br></span></div><div dir=3D"ltr" data-setdir=
=3D"false"><span>Thank You,</span></div><div dir=3D"ltr" data-setdir=3D"fal=
se"><span>Joseph Donaldson <br></span><div><br></div><div><br></div><div><b=
r></div><br></div><div><br></div><div><br></div><div><br></div></div></body=
></html>
------=_Part_2506951_1385129381.1710008443165--