{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,7,16]],"date-time":"2026-07-16T11:12:07Z","timestamp":1784200327502,"version":"3.55.0"},"reference-count":36,"publisher":"Association for Computing Machinery (ACM)","issue":"OOPSLA2","funder":[{"name":"DFG ? German Research Foundation","award":["448316946"],"award-info":[{"award-number":["448316946"]}]}],"content-domain":{"domain":["dl.acm.org"],"crossmark-restriction":true},"short-container-title":["Proc. ACM Program. Lang."],"published-print":{"date-parts":[[2025,10,9]]},"abstract":"<jats:p>Effect handlers offer an attractive way of abstracting over effectful computation. Moreover, languages with effect handlers usually statically track effects, which ensures the user is aware of all side effects different parts of a program might have. Similarly to exception handlers, effect handlers discharge effects by locally defining their behavior. In contrast to exception handlers, they allow for resuming computation, possibly later and possibly multiple times. In this paper we present a design, formalization, and implementation for a variant of dynamic wind that integrates well with lexical effect handlers. It has well-defined semantics in the presence of arbitrary control effects in arbitrary places. Specifically, the behavior of capturing and resuming continuations in the pre- or postlude is well-defined and respects resource bracketing. We demonstrate how these features can be used to express backtracking of external state and finalization of external resources.<\/jats:p>","DOI":"10.1145\/3763155","type":"journal-article","created":{"date-parts":[[2025,10,9]],"date-time":"2025-10-09T08:51:31Z","timestamp":1759999891000},"page":"2927-2953","update-policy":"https:\/\/doi.org\/10.1145\/crossmark-policy","source":"Crossref","is-referenced-by-count":1,"title":["Dynamic Wind for Effect Handlers"],"prefix":"10.1145","volume":"9","author":[{"ORCID":"https:\/\/orcid.org\/0009-0003-0140-6379","authenticated-orcid":false,"given":"David","family":"Voigt","sequence":"first","affiliation":[{"name":"University of T\u00fcbingen, T\u00fcbingen, Germany"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0001-8011-0506","authenticated-orcid":false,"given":"Philipp","family":"Schuster","sequence":"additional","affiliation":[{"name":"University of T\u00fcbingen, T\u00fcbingen, Germany"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0001-9128-0391","authenticated-orcid":false,"given":"Jonathan Immanuel","family":"Brachth\u00e4user","sequence":"additional","affiliation":[{"name":"University of T\u00fcbingen, T\u00fcbingen, Germany"}],"role":[{"vocabulary":"crossref","role":"author"}]}],"member":"320","published-online":{"date-parts":[[2025,10,9]]},"reference":[{"key":"e_1_3_2_2_1","doi-asserted-by":"publisher","DOI":"10.1016\/j.jlamp.2014.02.001"},{"key":"e_1_3_2_3_1","doi-asserted-by":"publisher","DOI":"10.1145\/3158096"},{"key":"e_1_3_2_4_1","doi-asserted-by":"publisher","DOI":"10.1145\/3527320"},{"key":"e_1_3_2_5_1","doi-asserted-by":"publisher","DOI":"10.1145\/3428194"},{"key":"e_1_3_2_6_1","unstructured":"Jonathan Immanuel Brachth\u00e4user and Daan Leijen. 2023. Qualified Effect Types \u2013 Taming Control-Flow through Linear Effect Handlers. Technical Report MSR-TR-2023-42. Microsoft Research."},{"key":"e_1_3_2_7_1","unstructured":"William D. Clinger. 2003. Implementation of unwind-protect in Portable Scheme. (2003). http:\/\/www.ccs.neu.edu\/home\/will\/UWESC\/uwesc.sch"},{"key":"e_1_3_2_8_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-031-30044-8_9"},{"key":"e_1_3_2_9_1","doi-asserted-by":"crossref","unstructured":"Paulo Em\u00edlio de Vilhena and Fran\u00e7ois Pottier. 2023b. A Type System for Effect Handlers and Dynamic Labels. (2023). https:\/\/devilhena-paulo.github.io\/files\/tes-slides.pdf","DOI":"10.1007\/978-3-031-30044-8_9"},{"key":"e_1_3_2_10_1","doi-asserted-by":"publisher","DOI":"10.1145\/1291151.1291178"},{"key":"e_1_3_2_11_1","doi-asserted-by":"publisher","DOI":"10.1145\/318593.318654"},{"key":"e_1_3_2_12_1","unstructured":"Daniel Hillerstr\u00f6m Filip Koprivec and Philipp Schuster. 2023. Effect handlers benchmarks suite. https:\/\/github.com\/effect-handlers\/effect-handlers-bench"},{"key":"e_1_3_2_13_1","doi-asserted-by":"publisher","DOI":"10.1017\/S0956796898003050"},{"key":"e_1_3_2_14_1","volume-title":"The Rust Programming Language","author":"Klabnik Steve","year":"2023","unstructured":"Steve Klabnik and Carol Nichols. 2023. The Rust Programming Language. No Starch Press."},{"key":"e_1_3_2_15_1","doi-asserted-by":"publisher","unstructured":"Daan Leijen. 2014. Koka: Programming with Row Polymorphic Effect Types In Proceedings of the Workshop on Mathematically Structured Functional Programming. Electronic Proceedings in Theoretical Computer Science. doi:10.4204\/eptcs.153.8","DOI":"10.4204\/eptcs.153.8"},{"key":"e_1_3_2_16_1","article-title":"Algebraic Effects for Functional Programming. Technical Report","author":"Leijen Daan","year":"2016","unstructured":"Daan Leijen. 2016. Algebraic Effects for Functional Programming. Technical Report. MSR-TR-2016-29. Microsoft Research technical report.","journal-title":"MSR-TR-2016-29. Microsoft Research technical report"},{"key":"e_1_3_2_17_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-319-71237-6_17"},{"key":"e_1_3_2_18_1","first-page":"35","article-title":"Algebraic Effect Handlers with Resources and Deep Finalization. Technical Report MSR-TR-2018-10","author":"Leijen Daan","year":"2018","unstructured":"Daan Leijen. 2018. Algebraic Effect Handlers with Resources and Deep Finalization. Technical Report MSR-TR-2018-10. Microsoft Research. 35 pages.","journal-title":"Microsoft Research"},{"key":"e_1_3_2_19_1","volume-title":"Ph. D. Dissertation","author":"Levy Paul Blain","year":"2001","unstructured":"Paul Blain Levy. 2001. Call-by-push-value. Ph. D. Dissertation. Queen Mary and Westfield College, University of London. https:\/\/pblevy.github.io\/papers\/thesisqmwphd.pdf Research Report No. RR-01-03."},{"key":"e_1_3_2_20_1","doi-asserted-by":"publisher","DOI":"10.1145\/73560.73564"},{"key":"e_1_3_2_21_1","doi-asserted-by":"publisher","DOI":"10.1145\/3022671.2984009"},{"key":"e_1_3_2_22_1","unstructured":"David Peter. 2023. hyperfine. https:\/\/github.com\/sharkdp\/hyperfine"},{"key":"e_1_3_2_23_1","doi-asserted-by":"publisher","DOI":"10.1145\/3622814"},{"key":"e_1_3_2_24_1","unstructured":"Kent Pitman. 2003. Unwind-Protect versus Continuations. (2003). http:\/\/www.nhplace.com\/kent\/PFAQ\/unwind-protect-vs-continuations-original.html"},{"key":"e_1_3_2_25_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-642-00590-9_7"},{"key":"e_1_3_2_26_1","doi-asserted-by":"publisher","DOI":"10.2168\/LMCS-9(4:23)2013"},{"key":"e_1_3_2_27_1","doi-asserted-by":"publisher","DOI":"10.1016\/j.entcs.2015.12.003"},{"key":"e_1_3_2_28_1","first-page":"513","volume-title":"Proceedings of the IFIP World Computer Congress","author":"Reynolds John C.","year":"1983","unstructured":"John C. Reynolds. 1983. Types, Abstraction and Parametric Polymorphism. In Proceedings of the IFIP World Computer Congress. Elsevier (North-Holland), Amsterdam, The Netherlands, 513\u2013523."},{"key":"e_1_3_2_29_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-030-99336-8_18"},{"key":"e_1_3_2_30_1","unstructured":"Dorai Sitaram. 2003. Unwind-protect in portable Scheme. In Proceedings of the 4th Workshop on Scheme and Functional Programming (2003-11-07) (Tech. Rep. UUCS-03-023) Matthew Flatt (Ed.). 48\u201352."},{"key":"e_1_3_2_31_1","doi-asserted-by":"publisher","DOI":"10.1145\/3453483.3454039"},{"key":"e_1_3_2_32_1","doi-asserted-by":"publisher","DOI":"10.5555\/2543987"},{"key":"e_1_3_2_33_1","doi-asserted-by":"publisher","DOI":"10.1145\/3632896"},{"key":"e_1_3_2_34_1","doi-asserted-by":"publisher","DOI":"10.1145\/3704841"},{"key":"e_1_3_2_35_1","doi-asserted-by":"publisher","unstructured":"David Voigt Philipp Schuster and Jonathan Immanuel Brachth\u00e4user. 2025. Dynamic Wind for Effect Handlers (Artifact). doi:10.5281\/zenodo.16901700","DOI":"10.5281\/zenodo.16901700"},{"key":"e_1_3_2_36_1","doi-asserted-by":"publisher","DOI":"10.1145\/99370.99404"},{"key":"e_1_3_2_37_1","doi-asserted-by":"publisher","DOI":"10.1145\/3290318"}],"container-title":["Proceedings of the ACM on Programming Languages"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/dl.acm.org\/doi\/pdf\/10.1145\/3763155","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2026,7,16]],"date-time":"2026-07-16T10:16:10Z","timestamp":1784196970000},"score":1,"resource":{"primary":{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3763155"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2025,10,9]]},"references-count":36,"journal-issue":{"issue":"OOPSLA2","published-print":{"date-parts":[[2025,10,9]]}},"alternative-id":["10.1145\/3763155"],"URL":"https:\/\/doi.org\/10.1145\/3763155","relation":{},"ISSN":["2475-1421"],"issn-type":[{"value":"2475-1421","type":"electronic"}],"subject":[],"published":{"date-parts":[[2025,10,9]]},"assertion":[{"value":"2025-03-26","order":0,"name":"received","label":"Received","group":{"name":"publication_history","label":"Publication History"}},{"value":"2025-08-12","order":2,"name":"accepted","label":"Accepted","group":{"name":"publication_history","label":"Publication History"}},{"value":"2025-10-09","order":3,"name":"published","label":"Published","group":{"name":"publication_history","label":"Publication History"}}]}}