Lexical effect handlers, directly (extended version)
| dc.contributor.author | Ma, Cong | |
| dc.contributor.author | Ge, Zhaoyi | |
| dc.contributor.author | Lee, Edward | |
| dc.contributor.author | Zhang, Yizhou | |
| dc.date.accessioned | 2026-07-30T15:13:36Z | |
| dc.date.issued | 2024-10-21 | |
| dc.description.abstract | Lexically 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.uri | https://hdl.handle.net/10012/23883 | |
| dc.language.iso | en | |
| dc.publisher | University of Waterloo | |
| dc.relation.ispartofseries | Computer Science Technical Reports; CS-2024-04 | |
| dc.title | Lexical effect handlers, directly (extended version) | |
| dc.type | Technical Report | |
| uws.contributor.affiliation1 | Faculty of Mathematics | |
| uws.contributor.affiliation2 | David R. Cheriton School of Computer Science | |
| uws.peerReviewStatus | Unreviewed | |
| uws.scholarLevel | Faculty | |
| uws.typeOfResource | Text | en |