<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="static/style.xsl"?><OAI-PMH xmlns="http://www.openarchives.org/OAI/2.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/ http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd"><responseDate>2026-11-22T10:56:30Z</responseDate><request verb="GetRecord" identifier="oai:uwspace.uwaterloo.ca:10012/23936" metadataPrefix="dim">https://dspacemainprd01.lib.uwaterloo.ca/server/oai/request</request><GetRecord><record><header><identifier>oai:uwspace.uwaterloo.ca:10012/23936</identifier><datestamp>2026-08-10T13:06:48Z</datestamp><setSpec>com_10012_9924</setSpec><setSpec>com_10012_1</setSpec><setSpec>col_10012_9930</setSpec><setSpec>col_10012_6</setSpec></header><metadata><dim:dim xmlns:dim="http://www.dspace.org/xmlns/dspace/dim" xmlns:doc="http://www.lyncode.com/xoai" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.dspace.org/xmlns/dspace/dim http://www.dspace.org/schema/dim.xsd">
   <dim:field mdschema="dc" element="contributor" qualifier="author">Ma, Cong</dim:field>
   <dim:field mdschema="dc" element="date" qualifier="accessioned">2026-08-10T13:06:47Z</dim:field>
   <dim:field mdschema="dc" element="date" qualifier="issued">2026-08-10</dim:field>
   <dim:field mdschema="dc" element="date" qualifier="submitted">2026-07-21</dim:field>
   <dim:field mdschema="dc" element="identifier" qualifier="uri">https://hdl.handle.net/10012/23936</dim:field>
   <dim:field mdschema="dc" element="description" qualifier="abstract">Effect handlers generalize exception handling to support control-flow patterns including coroutines, cooperative multitasking, and nondeterminism. Recent work advocates for lexically scoped handlers, which restore abstraction safety and enable modular reasoning: a handler is a lexically scoped capability, and an effect can be raised only to a handler whose capability is in scope. However, prior implementations of lexical effect handlers suffer from inefficiencies that could hinder their adoption in practice.

This thesis shows that the static character that makes lexical scoping safe is also what makes it efficient to implement. It develops this insight into three complementary compilation techniques, embodied in our language Lexa; each technique is made precise by a formal model, proven correct, and realized in the Lexa compiler. Direct Lexa identifies each handler with the stack address where it is installed, so a raise jumps directly to its handler, without any search. Zone Lexa extends the address-based strategy to multishot resumptions by virtualizing handler identities through a software memory-management unit. Zero Lexa serves infrequent effects such as exceptions: it avoids the cost of passing down any run-time handler identity, and instead walks the stack using the static handler provenance information when an effect is raised, so effect-free execution pays nothing. A single program can choose among the three techniques per effect, matching each declared effect to its expected usage.

Together, these techniques demonstrate that lexical effect handlers can be implemented efficiently. Effect handlers can be both safe and fast.</dim:field>
   <dim:field mdschema="dc" element="language" qualifier="iso">en</dim:field>
   <dim:field mdschema="dc" element="publisher" lang="en">University of Waterloo</dim:field>
   <dim:field mdschema="dc" element="subject">programming languages</dim:field>
   <dim:field mdschema="dc" element="subject">compilers</dim:field>
   <dim:field mdschema="dc" element="subject">effect handlers</dim:field>
   <dim:field mdschema="dc" element="subject">type systems</dim:field>
   <dim:field mdschema="dc" element="subject">semantics</dim:field>
   <dim:field mdschema="dc" element="subject">compiler verification</dim:field>
   <dim:field mdschema="dc" element="title">Implementation Techniques for Lexical Effect Handlers</dim:field>
   <dim:field mdschema="dc" element="type">Doctoral Thesis</dim:field>
   <dim:field mdschema="dc" element="pending">false</dim:field>
   <dim:field mdschema="uws-etd" element="degree" qualifier="department">David R. Cheriton School of Computer Science</dim:field>
   <dim:field mdschema="uws-etd" element="degree" qualifier="discipline">Computer Science</dim:field>
   <dim:field mdschema="uws-etd" element="degree" qualifier="grantor" lang="en">University of Waterloo</dim:field>
   <dim:field mdschema="uws-etd" element="degree">Doctor of Philosophy</dim:field>
   <dim:field mdschema="uws-etd" element="embargo" qualifier="terms">0</dim:field>
   <dim:field mdschema="uws" element="contributor" qualifier="advisor">Zhang, Yizhou</dim:field>
   <dim:field mdschema="uws" element="contributor" qualifier="affiliation1">Faculty of Mathematics</dim:field>
   <dim:field mdschema="uws" element="published" qualifier="city" lang="en">Waterloo</dim:field>
   <dim:field mdschema="uws" element="published" qualifier="country" lang="en">Canada</dim:field>
   <dim:field mdschema="uws" element="published" qualifier="province" lang="en">Ontario</dim:field>
   <dim:field mdschema="uws" element="typeOfResource" lang="en">Text</dim:field>
   <dim:field mdschema="uws" element="peerReviewStatus" lang="en">Unreviewed</dim:field>
   <dim:field mdschema="uws" element="scholarLevel" lang="en">Graduate</dim:field>
   <dim:field mdschema="others" element="access-status">open.access</dim:field>
</dim:dim>
</metadata></record></GetRecord></OAI-PMH>