Sujet : Re: Back & Forth - Co-routines
De : no.email (at) *nospam* nospam.invalid (Paul Rubin)
Groupes : comp.lang.forthDate : 11. Feb 2025, 23:17:31
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <87wmdwunwk.fsf@nightsong.com>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14
User-Agent : Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
minforth@gmx.net (minforth) writes:
Unfortunately, everything is very non-standard, as there is
no multitasking wordset (for historical reasons?).
A pity really, as co-operative multitasking existed very
early on in Forth.
I had thought there wasn't enough agreement about the wordset to
standardize it, and the same thing happened for cross development. But
at least for multitasking, there is reasonable shared understanding
about how it should work, at least in the cooperative case.
Then it would be easier to have better discussions about coroutines
(the original topic of this thread) or ownership of closure objects
and different variants of GC.
I think these fancy closures are mostly of interest to language geeks
and not so much in the old-fashioned Forth spirit. Coroutines don't
seem that important if you have multitasking. Anton's GC is great and I
think cooperative multitasking wouldn't affect it much, if you don't
mind the collection pauses. It would simply block during collection.
The GC hazard we're discussing is when there are real preemptive threads
and maybe multiple cores. This may also be reaching outside of Forth's
traditional areas of effectiveness. Software transactional memory (STM)
is another topic that should probably come up again. We haven't heard
from Andrew Haley in a while though.