{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,2,4]],"date-time":"2026-02-04T20:53:15Z","timestamp":1770238395468,"version":"3.49.0"},"reference-count":22,"publisher":"Association for Computing Machinery (ACM)","issue":"ICFP","license":[{"start":{"date-parts":[[2024,8,15]],"date-time":"2024-08-15T00:00:00Z","timestamp":1723680000000},"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":[[2024,8,15]]},"abstract":"<jats:p>Conventional wisdom suggests that the benefits of functional programming no longer apply in the presence of even a small amount of imperative code, as if the addition of imperative code effectively subtracts. And yet, as we show in this paper, combining functional programming with the special imperative language Esterel provides a multiplicative improvement to the benefits of functional programming.<\/jats:p>\n                  <jats:p>The key to the benefit of both Esterel and functional programming stems from a restriction that both share. As in functional programming, where only the inputs to a function determine its outputs, the state of an Esterel computation is fully determined by the program\u2019s input and the state that the computation had in the previous time step, where the notion of a time step is explicit in the language. Esterel\u2019s guarantee holds even though Esterel programs feature concurrent threads, mutable state, and the ability to create, suspend, and even terminate threads as the computation proceeds. This similarity is the root of the benefits that programmers accrue as they informally reason about their program\u2019s behavior.<\/jats:p>\n                  <jats:p>To illustrate these benefits, the bulk of this paper consists of an in-depth exploration of HipHop code (a mashup of JavaScript and Esterel) that implements a Sudoku solver, showing how it is possible to write code that is as easy to understand as if it were written in a pure functional programming style, even though it uses multiple threads, mutable state, thread preemption, and even thread abortion. Even better, concurrent composition and task canceling provide significant program structuring benefits that allow a clean decomposition and task separation in the solver.<\/jats:p>","DOI":"10.1145\/3674631","type":"journal-article","created":{"date-parts":[[2024,8,15]],"date-time":"2024-08-15T12:49:04Z","timestamp":1723726144000},"page":"177-202","update-policy":"https:\/\/doi.org\/10.1145\/crossmark-policy","source":"Crossref","is-referenced-by-count":0,"title":["The Functional, the Imperative, and the Sudoku: Getting Good, Bad, and Ugly to Get Along (Functional Pearl)"],"prefix":"10.1145","volume":"8","author":[{"ORCID":"https:\/\/orcid.org\/0000-0002-5240-1610","authenticated-orcid":false,"given":"Manuel","family":"Serrano","sequence":"first","affiliation":[{"name":"Inria, Sophia Antipolis, France"},{"name":"Universit\u00e9 C\u00f4te d'Azur, Nice, France"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-4245-2000","authenticated-orcid":false,"given":"Robert Bruce","family":"Findler","sequence":"additional","affiliation":[{"name":"Northwestern University, Evanston, USA"}],"role":[{"role":"author","vocabulary":"crossref"}]}],"member":"320","published-online":{"date-parts":[[2024,8,15]]},"reference":[{"key":"e_1_3_1_2_1","unstructured":"G\u00e9rard Berry. The Constructive Semantics of Pure Esterel Draft Version 3. https:\/\/www-sop.inria.fr\/members\/Gerard.Berry\/Papers\/EsterelConstructiveBook.pdf (accessed June 22 2024) 2002."},{"key":"e_1_3_1_3_1","doi-asserted-by":"publisher","DOI":"10.1016\/0167-6423(92)90005-V"},{"key":"e_1_3_1_4_1","doi-asserted-by":"publisher","unstructured":"G\u00e9rard Berry and Manuel Serrano. Hop and HipHop: Multitier Web Orchestration. In Proc. International Conference on Distributed Computing and Internet Technology 2014. doi:https:\/\/doi.org\/10.1007\/978-3-319-04483-5_1 10.1007\/978-3-319-04483-5_1","DOI":"10.1007\/978-3-319-04483-5_1"},{"key":"e_1_3_1_5_1","doi-asserted-by":"publisher","unstructured":"G\u00e9rard Berry and Manuel Serrano. HipHop.js: (A)Synchronous reactive web programming. In Proc. ACM Conference on Programming Language Design and Implementation 2020. doi:https:\/\/doi.org\/10.1145\/3385412.3385984 10.1145\/3385412.3385984","DOI":"10.1145\/3385412.3385984"},{"key":"e_1_3_1_6_1","doi-asserted-by":"publisher","DOI":"10.1002\/spe.4380210406"},{"key":"e_1_3_1_7_1","doi-asserted-by":"publisher","DOI":"10.1109\/32.491649"},{"key":"e_1_3_1_8_1","unstructured":"Corrado B\u00f6hm. DIGITAL COMPUTERS: On encoding logical-mathematical formulas using the machine itself during program conception. http:\/\/www.itu.dk\/~sestoft\/boehmthesis\/ 1954."},{"key":"e_1_3_1_9_1","unstructured":"Howard Garns. Dell Pencil Puzzles & Word Games. https:\/\/imgur.com\/a\/IH8mL 1979."},{"key":"e_1_3_1_10_1","unstructured":"N. Halbwachs and F. Maraninchi. On the symbolic analysis of combinational loops in circuits and synchronous programs. In Proc. Euromicro\u201995 1995."},{"key":"e_1_3_1_11_1","doi-asserted-by":"publisher","DOI":"10.1109\/5.97300"},{"key":"e_1_3_1_12_1","unstructured":"Bernhard Hobiger. HoDoKu. https:\/\/hodoku.sourceforge.net\/en\/techniques.php 2008."},{"key":"e_1_3_1_13_1","doi-asserted-by":"publisher","DOI":"10.1093\/comjnl\/32.2.98"},{"key":"e_1_3_1_14_1","doi-asserted-by":"publisher","unstructured":"Jayanth Krishnamurthy and Manuel Serrano. Causality Error Tracing in HipHop.Js. In Proc. 23rd International Symposium on Principles and Practice of Declarative Programming (PPDP) 2021. doi:https:\/\/doi.org\/10.1145\/3479394.3479408 10.1145\/3479394.3479408","DOI":"10.1145\/3479394.3479408"},{"key":"e_1_3_1_15_1","doi-asserted-by":"publisher","unstructured":"L Mandel C Pasteur and M Pouzet. ReactiveML Ten Years Later. In Proc. of the 17th ACM SIGPLAN International Symposium on Principles and Practice of Declarative Programming (PPDP\u201915) 2015. doi:https:\/\/doi.org\/10.1145\/2790449.2790509 10.1145\/2790449.2790509","DOI":"10.1145\/2790449.2790509"},{"key":"e_1_3_1_16_1","doi-asserted-by":"publisher","unstructured":"L Mandel and M Pouzet. ReactiveML a reactive extension to ML. In Proc. of the 7th ACM SIGPLAN Conference on Principles and Practice of Declarative Programming 2005. doi:https:\/\/doi.org\/10.1145\/1069774.1069782 10.1145\/1069774.1069782","DOI":"10.1145\/1069774.1069782"},{"key":"e_1_3_1_17_1","doi-asserted-by":"publisher","DOI":"10.1145\/367177.367199"},{"key":"e_1_3_1_18_1","unstructured":"Grant McLean. Sudoku Exchange \u201cPuzzle Bank\u201d. https:\/\/sudokuexchange.com\/puzzle-bank 2020."},{"key":"e_1_3_1_19_1","doi-asserted-by":"publisher","unstructured":"Dumitru Potop-Butucaru Stephen A. Edwards and G\u00e9rard Berry. Compiling Esterel. Springer 2007. doi:10.1007\/978-0-387-70628-3 10.1007\/978-0-387-70628-3","DOI":"10.1007\/978-0-387-70628-3"},{"key":"e_1_3_1_20_1","doi-asserted-by":"publisher","unstructured":"Klaus Schneider Jens Brandt Tobias Schuele and Thomas Tuerk. Maximal causality analysis. In Proc. Fifth International Conference on Application of Concurrency to System Design (ACSD\u201905) 2005. doi:https:\/\/doi.org\/10.1109\/ACSD.2005.24 10.1109\/ACSD.2005.24","DOI":"10.1109\/ACSD.2005.24"},{"key":"e_1_3_1_21_1","doi-asserted-by":"publisher","unstructured":"Ellen M. Sentovich. Quick conservative causality analysis. In Proc. Tenth International Symposium on System Synthesis (Cat. No. 97TB100114) 1997. doi:https:\/\/doi.org\/10.1109\/ISSS.1997.621669 10.1109\/ISSS.1997.621669","DOI":"10.1109\/ISSS.1997.621669"},{"key":"e_1_3_1_22_1","doi-asserted-by":"publisher","unstructured":"Manuel Serrano and Robert Bruce Findler. The Functional the Imperative and the Sudoku: Getting Good Bad and Ugly to Get Along (Artifact). https:\/\/github.com\/manuel-serrano\/icfp2024-sudoku 2024. doi:https:\/\/doi.org\/10.5281\/zenodo.12792675 10.5281\/zenodo.12792675","DOI":"10.5281\/zenodo.12792675"},{"key":"e_1_3_1_23_1","unstructured":"Thomas R. Shiple G\u00e9rard Berry and Herve Touati. Constructive analysis of cyclic circuits. In Proc. ED&TC European Design and Test Conference 1996. https:\/\/dl.acm.org\/doi\/10.5555\/787259.787602"}],"container-title":["Proceedings of the ACM on Programming Languages"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3674631","content-type":"unspecified","content-version":"vor","intended-application":"text-mining"},{"URL":"https:\/\/dl.acm.org\/doi\/pdf\/10.1145\/3674631","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2026,2,4]],"date-time":"2026-02-04T07:50:12Z","timestamp":1770191412000},"score":1,"resource":{"primary":{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3674631"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2024,8,15]]},"references-count":22,"journal-issue":{"issue":"ICFP","published-print":{"date-parts":[[2024,8,15]]}},"alternative-id":["10.1145\/3674631"],"URL":"https:\/\/doi.org\/10.1145\/3674631","relation":{},"ISSN":["2475-1421"],"issn-type":[{"value":"2475-1421","type":"electronic"}],"subject":[],"published":{"date-parts":[[2024,8,15]]},"assertion":[{"value":"2024-02-28","order":0,"name":"received","label":"Received","group":{"name":"publication_history","label":"Publication History"}},{"value":"2024-06-18","order":2,"name":"accepted","label":"Accepted","group":{"name":"publication_history","label":"Publication History"}},{"value":"2024-08-15","order":3,"name":"published","label":"Published","group":{"name":"publication_history","label":"Publication History"}}]}}