Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retrofitting effect handlers onto OCaml by KC Sivaramakrishnan and al., PLDI 2021 #8

Open
programLyrique opened this issue Oct 22, 2024 · 0 comments
Assignees
Labels
effects Effect systems types A paper about typing

Comments

@programLyrique
Copy link
Contributor

programLyrique commented Oct 22, 2024

Retrofitting effect handlers onto OCaml
KC Sivaramakrishnan, Stephen Dolan, Leo White, Tom Kelly, Sadiq Jaffer, Anil Madhavapeddy
PLDI 2021

PDF

Presentation

Abstract

Effect handlers have been gathering momentum as a mechanism for modular programming with user-defined effects. Effect handlers allow for non-local control flow mechanisms such as generators, async/await, lightweight threads and coroutines to be composably expressed. We present a design and evaluate a full-fledged efficient implementation of effect handlers for OCaml, an industrial-strength multi-paradigm programming language. Our implementation strives to maintain the backwards compatibility and performance profile of existing OCaml code. Retrofitting effect handlers onto OCaml is challenging since OCaml does not currently have any non-local control flow mechanisms other than exceptions. Our implementation of effect handlers for OCaml: (i) imposes a mean 1% overhead on a comprehensive macro benchmark suite that does not use effect handlers; (ii) remains compatible with program analysis tools that inspect the stack; and (iii) is efficient for new code that makes use of effect handlers.

Why are you interested in it or why should it be a good idea?

Mickael suggested the article.
Last year, we already talked about effects. That article describes an actual implementation of effects on a mainstream language, which did not support them before. The retroffiting approach is interesting in a PL design perspective: how do we evolve PL languages while maintaining backward and forward compatibility? (And also having users actually take advantage of the new features).

@programLyrique programLyrique added types A paper about typing effects Effect systems labels Oct 22, 2024
@programLyrique programLyrique self-assigned this Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effects Effect systems types A paper about typing
Projects
None yet
Development

No branches or pull requests

1 participant