fram-lang / fram-lang/dbl

Dynamic handlers

Open
#145 1 comment 0 reactions 0 assignees View on GitHub
0. parsing 1. type inference 2. effect inference
Dominant language
OCaml
Stars
45
Forks
28
PR merge metrics
No merged PRs in 30d

Description

Lexical effect handlers are nice and disciplined, but make some things, like [lightweight threads](https://github.com/fram-lang/dbl/blob/bc226d0baa747ee0419e04281fda1ce209adc6a2/examples/LWT_lexical.fram), difficult to express. Fram used to allow first-class labels to be generated and then used by multiple `handle` expressions, but that functionality had to be removed when the `return` and `finally` clauses were moved from `handle` to first-class handler creation with `handler` in bc226d0baa747ee0419e04281fda1ce209adc6a2, since the type and effect of the delimiter are no longer visible in the handler type.

Some form of dynamic handlers should be implemented in Fram. Part of the necessary work has already been done in c237db2340a1e8423b126626d0b97daecd7f7394, allowing convenient encoding of dynamic handlers in terms of shift₀ and reset₀, but nothing is exposed to the programmer yet. The old tests and example for first-class labels that were removed in bc226d0baa747ee0419e04281fda1ce209adc6a2 should potentially be reintroduced in some way.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.