Algebraic effects and handlers in portable C99

https://lobste.rs/rss Hits: 11
Summary

Warning: this library is still under active development and the API may change. libhandler implements algebraic effect handlers in C. It works by capturing stacks in safe and portable manner. Algebraic effects handlers can for example be used to program asynchronous code in straightline manner and we hope to use it to make programming with libuv more convenient. This library is described in detail in the accompanying technical report. For a primer on algebraic effects, see the relevant section in the koka book. Enjoy! -- Daan. Building libhandler consists of generating a static C library that can be linked in your own projects. libhandler is written to be as portable as possible but it depends on some platform specific assumptions regarding stacks and setjmp implementations. On new platforms please test carefully. Currently tested platforms include: (gcc,clang,cl)-x86-pc-windows (32 bit, Windows) (gcc,clang,cl)-x64-pc-windows (64 bit, Windows) (gcc,clang)-amd64-pc-linux (64 bit, Ubuntu 16.04) (gcc,clang)-arm-linux (32 bit, ARMv7 (raspberry pi 3, Raspbian/Debian Jessie)) gcc-arm64-linux (64 bit, ARMv8 (raspberry pi 3, Gentoo Linux)) C++ support is working but still under development. There is an initial test code for integrating with libuv in the test/libuv directory (in the dev branch). The Microsoft IDE solution contains a project for building with libuv. Build using regular configure and make: $ ./configure $ make depend $ make Use VARIANT=release to build a release version, and tests as a target to run tests. For example: $ make tests VARIANT=release Configuration options: --cc=<cc> : Specify the c-compiler to use (e.g. gcc, clang, etc.) --cc-opts=<options> : Specify extra c-compiler flags to use (e.g. -m64). --asm-opts=<options> : Specify extra assembler flags to use (e.g. -m64). --abi=<abi> : Specify the calling convention ABI. For example, --abi=amd64 or --abi=x64. --os=<os> : Specify the target OS, for example, --os=windows. --ar=<archiver> : Specify the arch...

First seen: 2026-07-23 02:54

Last seen: 2026-07-23 13:03