{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,7,16]],"date-time":"2026-07-16T10:10:05Z","timestamp":1784196605575,"version":"3.55.0"},"reference-count":51,"publisher":"Association for Computing Machinery (ACM)","issue":"ICFP","content-domain":{"domain":["dl.acm.org"],"crossmark-restriction":true},"short-container-title":["Proc. ACM Program. Lang."],"published-print":{"date-parts":[[2025,8,5]]},"abstract":"<jats:p>While enabling use cases such as backtracking search and probabilistic programming, multiple resumptions have the reputation of being incompatible with efficient implementation techniques, such as stack switching. This paper sets out to resolve this conflict and thus bridge the gap between expressiveness and performance. To this end, we present a compilation strategy and runtime system for lexical effect handlers with support for multiple resumptions and stack-allocated mutable state. By building on garbage-free reference counting and associating stacks with stable prompts, our approach enables constant-time continuation capture and resumption when resumed exactly once, as well as constant-time state access. Nevertheless, we also support multiple resumptions by copying stacks when necessary. We practically evaluate our approach by implementing an LLVM backend for the Effekt language. A performance comparison with state-of-the-art systems, including dynamic and lexical effect handler implementations, suggests that our approach achieves competitive performance and the increased expressiveness only comes with limited overhead.<\/jats:p>","DOI":"10.1145\/3747529","type":"journal-article","created":{"date-parts":[[2025,8,5]],"date-time":"2025-08-05T16:56:02Z","timestamp":1754412962000},"page":"704-733","update-policy":"https:\/\/doi.org\/10.1145\/crossmark-policy","source":"Crossref","is-referenced-by-count":1,"title":["Multiple Resumptions and Local Mutable State, Directly"],"prefix":"10.1145","volume":"9","author":[{"ORCID":"https:\/\/orcid.org\/0009-0004-0138-4218","authenticated-orcid":false,"given":"Serkan","family":"Muhcu","sequence":"first","affiliation":[{"name":"Technische Universit\u00e4t Berlin, Berlin, 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-5048-0741","authenticated-orcid":false,"given":"Michel","family":"Steuwer","sequence":"additional","affiliation":[{"name":"Technische Universit\u00e4t Berlin, Berlin, 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,8,5]]},"reference":[{"key":"e_1_3_2_2_1","doi-asserted-by":"publisher","DOI":"10.1145\/3689798"},{"key":"e_1_3_2_3_1","doi-asserted-by":"publisher","DOI":"10.1145\/3290319"},{"key":"e_1_3_2_4_1","unstructured":"Jonathan Immanuel Brachth\u00e4user. 2024. Optimize tailresumptive handlers. https:\/\/github.com\/effekt-lang\/effekt\/pull\/674. PR #674."},{"key":"e_1_3_2_5_1","doi-asserted-by":"publisher","DOI":"10.1145\/3527320"},{"key":"e_1_3_2_6_1","doi-asserted-by":"publisher","DOI":"10.1145\/3276481"},{"key":"e_1_3_2_7_1","doi-asserted-by":"publisher","DOI":"10.1145\/3428194"},{"key":"e_1_3_2_8_1","volume-title":"Programming with Implicit Values, Functions, and Control. Technical Report MSR-TR-2019-7","author":"Brachth\u00e4user Jonathan Immanuel","year":"2019","unstructured":"Jonathan Immanuel Brachth\u00e4user and Daan Leijen. 2019. Programming with Implicit Values, Functions, and Control. Technical Report MSR-TR-2019-7. Microsoft Research."},{"key":"e_1_3_2_9_1","doi-asserted-by":"publisher","DOI":"10.1145\/231379.231395"},{"key":"e_1_3_2_10_1","doi-asserted-by":"publisher","DOI":"10.1023\/A:1010016816429"},{"key":"e_1_3_2_11_1","doi-asserted-by":"publisher","DOI":"10.1145\/3434314"},{"key":"e_1_3_2_12_1","doi-asserted-by":"publisher","DOI":"10.1017\/S0956796807006259"},{"key":"e_1_3_2_13_1","doi-asserted-by":"publisher","DOI":"10.1145\/3385412.3385994"},{"key":"e_1_3_2_14_1","doi-asserted-by":"publisher","DOI":"10.1145\/3341642"},{"key":"e_1_3_2_15_1","doi-asserted-by":"publisher","DOI":"10.1145\/3385412.3385981"},{"key":"e_1_3_2_16_1","doi-asserted-by":"publisher","DOI":"10.1145\/1291151.1291178"},{"key":"e_1_3_2_17_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-642-46490-4_23"},{"key":"e_1_3_2_18_1","doi-asserted-by":"publisher","DOI":"10.1145\/581478.581504"},{"key":"e_1_3_2_19_1","doi-asserted-by":"publisher","DOI":"10.1145\/3563445"},{"key":"e_1_3_2_20_1","unstructured":"Oliver Goldstein and Ohad Kammar. 2024. Modular probabilistic programming with algebraic effects (MSc Thesis 2019). arXiv:2412.19826 [cs.PL] https:\/\/arxiv.org\/abs\/2412.19826"},{"key":"e_1_3_2_21_1","doi-asserted-by":"publisher","DOI":"10.1145\/224164.224173"},{"key":"e_1_3_2_22_1","doi-asserted-by":"publisher","DOI":"10.1016\/0743-1066(87)90016-1"},{"key":"e_1_3_2_23_1","doi-asserted-by":"publisher","DOI":"10.1145\/99163.99178"},{"key":"e_1_3_2_24_1","doi-asserted-by":"publisher","DOI":"10.1145\/93542.93554"},{"key":"e_1_3_2_25_1","volume-title":"Formal Structures for Computation and Deduction (LIPIcs, Vol. 84)","author":"Hillerstr\u00f6m Daniel","year":"2017","unstructured":"Daniel Hillerstr\u00f6m, Sam Lindley, Bob Atkey, and KC Sivaramakrishnan. 2017. Continuation Passing Style for Effect Handlers. In Formal Structures for Computation and Deduction (LIPIcs, Vol. 84). Schloss Dagstuhl\u2013Leibniz-Zentrum f\u00fcr Informatik."},{"key":"e_1_3_2_26_1","unstructured":"Daniel Hillerstr\u00f6m Filip Koprivec and Philipp Schuster (benchmarking chairs). 2023. Effect handlers benchmarks suite. (2023). https:\/\/github.com\/effect-handlers\/effect-handlers-bench"},{"key":"e_1_3_2_27_1","unstructured":"Alexis King. 2022. Native first-class delimited continuations. https:\/\/gitlab.haskell.org\/ghc\/ghc\/-\/merge_requests\/7942. MR #7942."},{"key":"e_1_3_2_28_1","doi-asserted-by":"publisher","DOI":"10.1016\/j.tcs.2012.02.025"},{"key":"e_1_3_2_29_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-642-03034-5_17"},{"key":"e_1_3_2_30_1","doi-asserted-by":"publisher","DOI":"10.1145\/1159803.1159808"},{"key":"e_1_3_2_31_1","doi-asserted-by":"publisher","DOI":"10.1145\/1378533.1378563"},{"key":"e_1_3_2_32_1","unstructured":"Daan Leijen. 2016. Algebraic Effects for Functional Programming. Technical Report. MSR-TR-2016-29. Microsoft Research technical report."},{"key":"e_1_3_2_33_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-319-71237-6_17"},{"key":"e_1_3_2_34_1","doi-asserted-by":"publisher","DOI":"10.1145\/3093333.3009872"},{"key":"e_1_3_2_35_1","unstructured":"libuv. 2025. libuv: Cross-platform asynchronous I\/O. https:\/\/libuv.org\/Accessed: 2025-02-28."},{"key":"e_1_3_2_36_1","doi-asserted-by":"publisher","DOI":"10.1145\/3009837.3009897"},{"key":"e_1_3_2_37_1","doi-asserted-by":"publisher","DOI":"10.1145\/3656393"},{"key":"e_1_3_2_38_1","doi-asserted-by":"publisher","DOI":"10.1145\/3689770"},{"key":"e_1_3_2_39_1","doi-asserted-by":"publisher","DOI":"10.1145\/1596627.1596636"},{"key":"e_1_3_2_40_1","doi-asserted-by":"publisher","DOI":"10.1145\/3622831"},{"key":"e_1_3_2_41_1","doi-asserted-by":"publisher","DOI":"10.1145\/3679005.3685979"},{"key":"e_1_3_2_42_1","article-title":"Composable effects for flexible and accelerated probabilistic programming in NumPyro","author":"Phan Du","year":"2019","unstructured":"Du Phan, Neeraj Pradhan, and Martin Jankowiak. 2019. Composable effects for flexible and accelerated probabilistic programming in NumPyro. arXiv preprint arXiv:1912.11554 (2019).","journal-title":"arXiv preprint arXiv:1912.11554"},{"key":"e_1_3_2_43_1","doi-asserted-by":"publisher","DOI":"10.1145\/3622814"},{"key":"e_1_3_2_44_1","doi-asserted-by":"publisher","DOI":"10.2168\/LMCS-9(4:23)2013"},{"key":"e_1_3_2_45_1","unstructured":"Ron Pressler. 2018. Multiprompt delimited continuations. https:\/\/mail.openjdk.org\/pipermail\/loom-dev\/2018-September\/000145.html. loom-dev mailing list."},{"key":"e_1_3_2_46_1","doi-asserted-by":"publisher","DOI":"10.1145\/3453483.3454032"},{"key":"e_1_3_2_47_1","doi-asserted-by":"publisher","DOI":"10.1017\/S147106841600034X"},{"key":"e_1_3_2_48_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-030-99336-8_18"},{"key":"e_1_3_2_49_1","doi-asserted-by":"publisher","DOI":"10.1145\/3453483.3454039"},{"key":"e_1_3_2_50_1","doi-asserted-by":"publisher","DOI":"10.1145\/3704841"},{"key":"e_1_3_2_51_1","doi-asserted-by":"publisher","DOI":"10.1145\/3473576"},{"key":"e_1_3_2_52_1","doi-asserted-by":"publisher","DOI":"10.1145\/3428207"}],"container-title":["Proceedings of the ACM on Programming Languages"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/dl.acm.org\/doi\/pdf\/10.1145\/3747529","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2026,7,16]],"date-time":"2026-07-16T10:01:25Z","timestamp":1784196085000},"score":1,"resource":{"primary":{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3747529"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2025,8,5]]},"references-count":51,"journal-issue":{"issue":"ICFP","published-print":{"date-parts":[[2025,8,5]]}},"alternative-id":["10.1145\/3747529"],"URL":"https:\/\/doi.org\/10.1145\/3747529","relation":{},"ISSN":["2475-1421"],"issn-type":[{"value":"2475-1421","type":"electronic"}],"subject":[],"published":{"date-parts":[[2025,8,5]]},"assertion":[{"value":"2025-02-27","order":0,"name":"received","label":"Received","group":{"name":"publication_history","label":"Publication History"}},{"value":"2025-06-27","order":2,"name":"accepted","label":"Accepted","group":{"name":"publication_history","label":"Publication History"}},{"value":"2025-08-05","order":3,"name":"published","label":"Published","group":{"name":"publication_history","label":"Publication History"}}]}}