On Wed, Jul 31, 2019 at 5:21 PM Lassi Kortela <xxxxxx@lassi.io> wrote:

Kent Pitman once made an extended
argument that he'd rather not have continuations because they break some
guarantees about unwind-protect.

Yes, unwind-protect is impossible in vanilla Scheme because you don't know when you escape whether you're going to jump back in (so no unwinding) or not (unwinding is appropriate).  Note that dynamic-wind is *not* unwind-protect for this reason.  Distinguishing between general escape procedures and use-once-only escape procedures would help a whole lot.

I have believed for a long time that goroutines (which can be implemented on top of SRFI 18) are in some sense the Right Thing.  See <http://wiki.call-cc.org/eggref/5/gochan>.  That way you can get shared-almost-nothing (with some self-discipline) with the intra-process analogue of pipes, which are a very nice way to provide concurrency.

You don't need await/async decorators in Scheme because we have ... call/cc!


As for tail calls, recursive code in Scheme just reads very very nicely
and makes it trivial to avoid common bugs with accidentally re-using a
variable (since variables are re-bound at each recursion step). It would
be really nice if we could write code for the browser using tail calls.

Yes, tail *recursion* is easy to do with loops and jumps.  It's *general* tail calls (to arbitrary procedures) that are hard.


John Cowan          http://vrici.lojban.org/~cowan        xxxxxx@ccil.org
Said Agatha Christie / To E. Philips Oppenheim
"Who is this Hemingway? / Who is this Proust?
Who is this Vladimir / Whatchamacallum,
This neopostrealist / Rabble?" she groused.
        --George Starbuck, Pith and Vinegar