{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,2,14]],"date-time":"2026-02-14T05:09:21Z","timestamp":1771045761931,"version":"3.50.1"},"reference-count":33,"publisher":"Association for Computing Machinery (ACM)","issue":"OOPSLA2","license":[{"start":{"date-parts":[[2022,10,31]],"date-time":"2022-10-31T00:00:00Z","timestamp":1667174400000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0\/"}],"content-domain":{"domain":["dl.acm.org"],"crossmark-restriction":true},"short-container-title":["Proc. ACM Program. Lang."],"published-print":{"date-parts":[[2022,10,31]]},"abstract":"<jats:p>Effect handlers allow the programmer to implement computational effects, such as custom error handling, various forms of lightweight concurrency, and dynamic binding, inside the programming language. We introduce cpp-effects, a C++ library for effect handlers with a typed high-level, object-oriented interface. We demonstrate that effect handlers can be successfully applied in imperative systems programming languages with manual memory management. Through a collection of examples, we explore how to program effectively with effect handlers in C++, discuss the intricacies and challenges of the implementation, and show that despite its limitations, cpp-effects performance is competitive and in some cases even outperforms state-of-the-art approaches such as C++20 coroutines and the libmprompt library for multiprompt delimited control.<\/jats:p>","DOI":"10.1145\/3563445","type":"journal-article","created":{"date-parts":[[2022,10,31]],"date-time":"2022-10-31T20:23:35Z","timestamp":1667247815000},"page":"1639-1667","update-policy":"https:\/\/doi.org\/10.1145\/crossmark-policy","source":"Crossref","is-referenced-by-count":14,"title":["High-level effect handlers in C++"],"prefix":"10.1145","volume":"6","author":[{"ORCID":"https:\/\/orcid.org\/0000-0002-4003-8893","authenticated-orcid":false,"given":"Dan","family":"Ghica","sequence":"first","affiliation":[{"name":"Huawei, UK"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-1360-4714","authenticated-orcid":false,"given":"Sam","family":"Lindley","sequence":"additional","affiliation":[{"name":"University of Edinburgh, UK"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"ORCID":"https:\/\/orcid.org\/0000-0003-1035-5625","authenticated-orcid":false,"given":"Marcos Maro\u00f1as","family":"Bravo","sequence":"additional","affiliation":[{"name":"Huawei, UK"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-5889-3388","authenticated-orcid":false,"given":"Maciej","family":"Pir\u00f3g","sequence":"additional","affiliation":[{"name":"Huawei, UK"}],"role":[{"role":"author","vocabulary":"crossref"}]}],"member":"320","published-online":{"date-parts":[[2022,10,31]]},"reference":[{"key":"e_1_2_1_1_1","volume-title":"Concurrent Programming in Erlang","author":"Armstrong Joe","unstructured":"Joe Armstrong , Robert Virding , Claes Wikstr\u00f6m , and Mike Williams . 1996. Concurrent Programming in Erlang , Second Edition. Prentice Hall International , Hertfordshire, UK . Joe Armstrong, Robert Virding, Claes Wikstr\u00f6m, and Mike Williams. 1996. Concurrent Programming in Erlang, Second Edition. Prentice Hall International, Hertfordshire, UK."},{"key":"e_1_2_1_2_1","doi-asserted-by":"publisher","DOI":"10.1016\/j.jlamp.2014.02.001"},{"key":"e_1_2_1_3_1","doi-asserted-by":"publisher","DOI":"10.1145\/3290319"},{"key":"e_1_2_1_4_1","doi-asserted-by":"publisher","DOI":"10.1145\/3371116"},{"key":"e_1_2_1_5_1","article-title":"Pyro: Deep Universal Probabilistic Programming","volume":"20","author":"Bingham Eli","year":"2019","unstructured":"Eli Bingham , Jonathan P. Chen , Martin Jankowiak , Fritz Obermeyer , Neeraj Pradhan , Theofanis Karaletsos , Rohit Singh , Paul A. Szerlip , Paul Horsfall , and Noah D. Goodman . 2019 . Pyro: Deep Universal Probabilistic Programming . J. Mach. Learn. Res. , 20 (2019), 28:1\u20136. Eli Bingham, Jonathan P. Chen, Martin Jankowiak, Fritz Obermeyer, Neeraj Pradhan, Theofanis Karaletsos, Rohit Singh, Paul A. Szerlip, Paul Horsfall, and Noah D. Goodman. 2019. Pyro: Deep Universal Probabilistic Programming. J. Mach. Learn. Res., 20 (2019), 28:1\u20136.","journal-title":"J. Mach. Learn. Res."},{"key":"e_1_2_1_6_1","unstructured":"Boost. 2022. Boost.context library.  https:\/\/github.com\/boostorg\/context \t\t\t\t  Boost. 2022. Boost.context library.  https:\/\/github.com\/boostorg\/context"},{"key":"e_1_2_1_7_1","doi-asserted-by":"publisher","DOI":"10.1145\/3276481"},{"key":"e_1_2_1_8_1","doi-asserted-by":"publisher","DOI":"10.1017\/S0956796820000027"},{"key":"e_1_2_1_9_1","volume-title":"LOLA 2018: Workshop on Syntax and Semantics of Low-Level Languages. 1\u20134.","author":"Combette Guillaume","year":"2018","unstructured":"Guillaume Combette and Guillaume Munch-Maccagnoni . 2018 . A resource modality for RAII . In LOLA 2018: Workshop on Syntax and Semantics of Low-Level Languages. 1\u20134. Guillaume Combette and Guillaume Munch-Maccagnoni. 2018. A resource modality for RAII. In LOLA 2018: Workshop on Syntax and Semantics of Low-Level Languages. 1\u20134."},{"key":"e_1_2_1_10_1","doi-asserted-by":"publisher","DOI":"10.1017\/S0956796820000039"},{"key":"e_1_2_1_11_1","doi-asserted-by":"publisher","DOI":"10.1145\/3554330"},{"key":"e_1_2_1_12_1","unstructured":"GitHub. 2022. Semantic library.  https:\/\/github.com\/github\/semantic \t\t\t\t  GitHub. 2022. Semantic library.  https:\/\/github.com\/github\/semantic"},{"key":"e_1_2_1_13_1","unstructured":"Daniel Hillerstr\u00f6m Daan Leijen Sam Lindley Matija Pretnar Andreas Rossberg and KC Sivamarakrishnan. 2022. WebAssembly Typed Continuations Proposal.  https:\/\/github.com\/effect-handlers\/wasm-spec\/proposals\/continuations\/Explainer.md \t\t\t\t  Daniel Hillerstr\u00f6m Daan Leijen Sam Lindley Matija Pretnar Andreas Rossberg and KC Sivamarakrishnan. 2022. WebAssembly Typed Continuations Proposal.  https:\/\/github.com\/effect-handlers\/wasm-spec\/proposals\/continuations\/Explainer.md"},{"key":"e_1_2_1_14_1","doi-asserted-by":"publisher","DOI":"10.1145\/2976022.2976033"},{"key":"e_1_2_1_15_1","doi-asserted-by":"publisher","DOI":"10.1145\/3276954.3276955"},{"key":"e_1_2_1_16_1","doi-asserted-by":"publisher","DOI":"10.1145\/2544174.2500590"},{"key":"e_1_2_1_17_1","doi-asserted-by":"publisher","DOI":"10.1145\/2103621.2103691"},{"key":"e_1_2_1_18_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-319-71237-6_17"},{"key":"e_1_2_1_19_1","doi-asserted-by":"publisher","DOI":"10.1145\/3093333.3009872"},{"key":"e_1_2_1_20_1","unstructured":"Daan Leijen. 2019. libhandler.  https:\/\/github.com\/koka-lang\/libhandler \t\t\t\t  Daan Leijen. 2019. libhandler.  https:\/\/github.com\/koka-lang\/libhandler"},{"key":"e_1_2_1_21_1","unstructured":"Daan Leijen and KC Sivamarakrishnan. 2022. libmprompt.  https:\/\/github.com\/koka-lang\/libmprompt \t\t\t\t  Daan Leijen and KC Sivamarakrishnan. 2022. libmprompt.  https:\/\/github.com\/koka-lang\/libmprompt"},{"key":"e_1_2_1_22_1","unstructured":"Meta. 2022. React library.  https:\/\/reactjs.org\/ \t\t\t\t  Meta. 2022. React library.  https:\/\/reactjs.org\/"},{"key":"e_1_2_1_23_1","doi-asserted-by":"publisher","DOI":"10.1016\/S1571-0661(04)80970-8"},{"key":"e_1_2_1_24_1","doi-asserted-by":"publisher","DOI":"10.1007\/3-540-45931-6_24"},{"key":"e_1_2_1_25_1","doi-asserted-by":"publisher","DOI":"10.1023\/A:1023064908962"},{"key":"e_1_2_1_26_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-642-00590-9_7"},{"key":"e_1_2_1_27_1","doi-asserted-by":"publisher","DOI":"10.2168\/LMCS-9(4:23)2013"},{"key":"e_1_2_1_28_1","doi-asserted-by":"publisher","DOI":"10.1145\/3062341.3062363"},{"key":"e_1_2_1_29_1","doi-asserted-by":"publisher","DOI":"10.1145\/3453483.3454039"},{"key":"e_1_2_1_30_1","unstructured":"WebAssembly Community Group. 2022. WebAssembly Stack Switching Extension.  https:\/\/github.com\/WebAssembly\/stack-switching \t\t\t\t  WebAssembly Community Group. 2022. WebAssembly Stack Switching Extension.  https:\/\/github.com\/WebAssembly\/stack-switching"},{"key":"e_1_2_1_31_1","doi-asserted-by":"publisher","DOI":"10.1145\/3408981"},{"key":"e_1_2_1_32_1","doi-asserted-by":"publisher","DOI":"10.1145\/3473576"},{"key":"e_1_2_1_33_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\/10.1145\/3563445","content-type":"unspecified","content-version":"vor","intended-application":"text-mining"},{"URL":"https:\/\/dl.acm.org\/doi\/pdf\/10.1145\/3563445","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2025,6,17]],"date-time":"2025-06-17T17:49:36Z","timestamp":1750182576000},"score":1,"resource":{"primary":{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3563445"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2022,10,31]]},"references-count":33,"journal-issue":{"issue":"OOPSLA2","published-print":{"date-parts":[[2022,10,31]]}},"alternative-id":["10.1145\/3563445"],"URL":"https:\/\/doi.org\/10.1145\/3563445","relation":{},"ISSN":["2475-1421"],"issn-type":[{"value":"2475-1421","type":"electronic"}],"subject":[],"published":{"date-parts":[[2022,10,31]]},"assertion":[{"value":"2022-10-31","order":2,"name":"published","label":"Published","group":{"name":"publication_history","label":"Publication History"}}]}}