Algebraic effects and handlers in portable C99
4 points by aka_dude
4 points by aka_dude
It works by capturing stacks in safe and portable manner
Well there’s a terrifying line in a readme. I might accept ‘portable’, but there is no such thing as ‘safe’ for C code. Anything doing stack capture can introduce self-deadlock if it isn’t replacing all locks (including hand-written spin locks), can cause data corruption when there are data structures interleaving TLS and stack variables, and so on.
10 years ago; no clear examples of what this looks like unfortunately.
There’s also the slightly more recent https://github.com/koka-lang/libmprompt and I couldn’t immediately find out how they relate to each other or to the koka runtime.
7, to be exact. There are tests (https://github.com/koka-lang/libhandler/blob/0f1e367ca9be736b09b62480ef0039b0b3d1ad8f/test/test-amb.c#L75) and the report (https://www.microsoft.com/en-us/research/publication/implementing-algebraic-effects-c), both describe usecases