Lexical effect handlers, directly (extended version)

dc.contributor.authorMa, Cong
dc.contributor.authorGe, Zhaoyi
dc.contributor.authorLee, Edward
dc.contributor.authorZhang, Yizhou
dc.date.accessioned2026-07-30T15:13:36Z
dc.date.issued2024-10-21
dc.description.abstractLexically scoping effect handlers is a language-design idea that equips algebraic effects with a modular semantics: it enables local-reasoning principles without giving up on the control-flow expressiveness that makes effect handlers powerful. However, we observe that existing implementations risk incurring costs akin to the run-time search for dynamically scoped handlers. This paper presents a compilation strategy for lexical effect handlers, adhering to the lexical scoping principle and targeting a language with low-level control over stack layout. Key aspects of this approach are formalized and proven correct. We embody the ideas in a language called Lexa: the Lexa compiler translates high-level effect handling to low-level stack switching. We evaluate the the Lexa compiler on a set of benchmarks; the results suggest that it generates efficient code, reducing running-time complexity from quadratic to linear in some cases.
dc.identifier.urihttps://hdl.handle.net/10012/23883
dc.language.isoen
dc.publisherUniversity of Waterloo
dc.relation.ispartofseriesComputer Science Technical Reports; CS-2024-04
dc.titleLexical effect handlers, directly (extended version)
dc.typeTechnical Report
uws.contributor.affiliation1Faculty of Mathematics
uws.contributor.affiliation2David R. Cheriton School of Computer Science
uws.peerReviewStatusUnreviewed
uws.scholarLevelFaculty
uws.typeOfResourceTexten

Files

Original bundle

Now showing 1 - 1 of 1
Loading...
Thumbnail Image
Name:
cs-2024-04.pdf
Size:
701.65 KB
Format:
Adobe Portable Document Format

License bundle

Now showing 1 - 1 of 1
Loading...
Thumbnail Image
Name:
license.txt
Size:
4.47 KB
Format:
Item-specific license agreed upon to submission
Description: