Parallel evaluation of expressions within (perform )
Vladimir Nikishkin 15 Oct 2022 02:36 UTC
Dear SRFI contributors,
Dear Mark
This SRFI looks very straightforward, however, I am feeling that there
is more to it than it seems.
At the moment, as it is written, it seems perfectly valid to spawn a
separate thread (or a green thread) per expression within a (perform )
form. And also perfectly valid not to. However, if one tries to
manually sequence those expressions using mutexes and waiting, the
first (threaded) case will work, whereas the second will fail. And
there seems to be no a priori way to distinguish between these two
cases.
Additionally, it seems to be useful to have a form that is almost like
"perform", but actually tries to randomise the evaluation order each
time it is used. Useful in that it would make broken code that
actually relies on evaluation order unbeknownst to a newbie programmer
fail with high probability, rather than silently succeeding on an
implementation A and fail with low probability on an implementation B.
So I guess what I am trying to say is that in its current form (pun
intended) it seems to be highly likely that two syntactically and
semantically conformant implementations of this form will turn out to
be incompatible within themselves. And if implemented naively, this
form will be even worse than an overspecified "begin".
--
Yours sincerely, Vladimir Nikishkin
(Sent from GMail web interface.)