chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Threading, mailboxes, and exceptions


From: felix . winkelmann
Subject: Re: Threading, mailboxes, and exceptions
Date: Sat, 04 Mar 2023 23:05:25 +0100

> Also I'm from Python land, where exceptions are never resumable. The YouTube 
> talks about Common Lisp rave about conditions, mostly in the context of 
> interactive development ("Call a function that doesn't exist yet!" etc). Now 
> here I see exceptions and conditions, and they are well enough documented 
> that I can catch them, but I don't feel like I really understand them. Where 
> does one learn about Scheme conditions and why they are what they are and not 
> something different?

Hi! Pure Scheme has no exception system, so the only sources are
implementation specific features or SRFIs that address creating and
handling exceptions. This situation is typical for Scheme, which has
a very small and simple core language but leaves additional features
at the discretion of implementations. Common Lisp's condition system
is very powerful and sort-of standardized, but completely separate
from the Scheme world. This has both advantages and disadvantages, I
think. Resumable exceptions can be cool but can also make control-flow
completely inscrutable.

I would refrain from using exceptions for controlling the flow of
computations. Have you looked at http://api.call-cc.org/5/doc/gochan ?
This model of communication may be more robust and flexible than using
the bare threading facilities. I haven't used it myself, but I believe
the erlang-inspired message passing / actor concept has turned out to be
a pretty good model of writing concurrent code.


felix




reply via email to

[Prev in Thread] Current Thread [Next in Thread]