{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,4,11]],"date-time":"2026-04-11T02:14:56Z","timestamp":1775873696144,"version":"3.50.1"},"reference-count":52,"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>Multi-stage programming has been used in a wide variety of domains to eliminate the tension between abstraction and performance. However, the interaction of multi-stage programming features with features for programming-in-the-large remains understudied, hindering the full integration of multi-stage programming support into existing languages, and limiting the effective use of staging in large programs.<\/jats:p>\n                  <jats:p>\n                    We take steps to remedy the situation by studying the extension of MacoCaml, a recent OCaml extension that supports compile-time code generation via\n                    <jats:italic toggle=\"yes\">macros<\/jats:italic>\n                    and\n                    <jats:italic toggle=\"yes\">quotations<\/jats:italic>\n                    , with module functors, the key mechanism in OCaml for assembling program components into larger units. We discuss design choices related to evaluation order, formalize our calculus via elaboration, and show that the design enjoys key metatheoretical properties: syntactic type soundness, elaboration soundness, and phase distinction. We believe that this study lays a foundation for the continued exploration and implementation of the OCaml macro system.\n                  <\/jats:p>","DOI":"10.1145\/3674649","type":"journal-article","created":{"date-parts":[[2024,8,15]],"date-time":"2024-08-15T12:49:04Z","timestamp":1723726144000},"page":"693-727","update-policy":"https:\/\/doi.org\/10.1145\/crossmark-policy","source":"Crossref","is-referenced-by-count":5,"title":["Staged Compilation with Module Functors"],"prefix":"10.1145","volume":"8","author":[{"ORCID":"https:\/\/orcid.org\/0000-0003-1252-6424","authenticated-orcid":false,"given":"Tsung-Ju","family":"Chiang","sequence":"first","affiliation":[{"name":"University of Toronto, Toronto, Canada"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"ORCID":"https:\/\/orcid.org\/0009-0002-1650-6340","authenticated-orcid":false,"given":"Jeremy","family":"Yallop","sequence":"additional","affiliation":[{"name":"University of Cambridge, Cambridge, United Kingdom"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"ORCID":"https:\/\/orcid.org\/0009-0003-7046-3035","authenticated-orcid":false,"given":"Leo","family":"White","sequence":"additional","affiliation":[{"name":"Jane Street Capital, London, United Kingdom"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-5961-1493","authenticated-orcid":false,"given":"Ningning","family":"Xie","sequence":"additional","affiliation":[{"name":"University of Toronto, Toronto, Canada"}],"role":[{"role":"author","vocabulary":"crossref"}]}],"member":"320","published-online":{"date-parts":[[2024,8,15]]},"reference":[{"key":"e_1_3_1_2_1","doi-asserted-by":"publisher","DOI":"10.1145\/178243.178245"},{"key":"e_1_3_1_3_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-540-39815-8_4"},{"key":"e_1_3_1_4_1","doi-asserted-by":"publisher","DOI":"10.1145\/1929501.1929510"},{"key":"e_1_3_1_5_1","doi-asserted-by":"publisher","DOI":"10.1007\/11561347_18"},{"key":"e_1_3_1_6_1","doi-asserted-by":"publisher","DOI":"10.1017\/S0956796809007205"},{"key":"e_1_3_1_7_1","doi-asserted-by":"publisher","DOI":"10.1145\/301618.301641"},{"key":"e_1_3_1_8_1","doi-asserted-by":"publisher","DOI":"10.1109\/LICS.1996.561317"},{"key":"e_1_3_1_9_1","doi-asserted-by":"publisher","DOI":"10.1145\/237721.237788"},{"key":"e_1_3_1_10_1","volume-title":"Camlp5 - Reference Manual","author":"Rauglaudre Daniel de","year":"2007","unstructured":"Daniel de Rauglaudre. 2007. Camlp5 - Reference Manual. Institut National de Recherche en Informatique et Automatique."},{"key":"e_1_3_1_11_1","doi-asserted-by":"publisher","DOI":"10.21236\/ADA460172"},{"key":"e_1_3_1_12_1","doi-asserted-by":"publisher","DOI":"10.1145\/317636.317800"},{"key":"e_1_3_1_13_1","doi-asserted-by":"publisher","DOI":"10.1145\/581478.581486"},{"key":"e_1_3_1_14_1","doi-asserted-by":"publisher","DOI":"10.1145\/507635.507646"},{"key":"e_1_3_1_15_1","first-page":"341","article-title":"Higher-order modules and the phase distinction","author":"Harper Robert","year":"1989","unstructured":"Robert Harper, John C Mitchell, and Eugenio Moggi. 1989. Higher-order modules and the phase distinction. In Proceedings of the 17th ACM SIGPLAN-SIGACT symposium on Principles of programming languages. 341\u2013354.","journal-title":"Proceedings of the 17th ACM SIGPLAN-SIGACT symposium on Principles of programming languages"},{"key":"e_1_3_1_16_1","doi-asserted-by":"publisher","DOI":"10.7551\/mitpress\/5641.003.0019"},{"key":"e_1_3_1_17_1","doi-asserted-by":"publisher","DOI":"10.1145\/2847538.2847548"},{"key":"e_1_3_1_18_1","doi-asserted-by":"publisher","DOI":"10.1145\/3498700"},{"key":"e_1_3_1_19_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-319-07151-0_6"},{"key":"e_1_3_1_20_1","doi-asserted-by":"publisher","DOI":"10.1145\/3547641"},{"key":"e_1_3_1_21_1","doi-asserted-by":"publisher","DOI":"10.1145\/174675.176926"},{"key":"e_1_3_1_22_1","doi-asserted-by":"publisher","DOI":"10.1145\/73560.73563"},{"key":"e_1_3_1_23_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-031-30044-8_11"},{"key":"e_1_3_1_24_1","doi-asserted-by":"publisher","DOI":"10.1145\/1352582.1352591"},{"key":"e_1_3_1_25_1","unstructured":"Gabriel Radanne Thomas Gazagnaire Anil Madhavapeddy Jeremy Yallop Richard Mortier Hannes Mehnert Mindy Preston and David J. Scott. 2019. Programming Unikernels in the Large via Functor Driven Development. CoRR abs\/1905.02529 (2019). arXiv:1905.02529 http:\/\/arxiv.org\/abs\/1905.02529"},{"key":"e_1_3_1_26_1","doi-asserted-by":"publisher","DOI":"10.1145\/1868294.1868314"},{"key":"e_1_3_1_27_1","doi-asserted-by":"publisher","DOI":"10.1017\/S0956796818000205"},{"key":"e_1_3_1_28_1","doi-asserted-by":"publisher","DOI":"10.1017\/S0956796814000264"},{"key":"e_1_3_1_29_1","doi-asserted-by":"publisher","DOI":"10.1145\/3486609.3487209"},{"key":"e_1_3_1_30_1","doi-asserted-by":"publisher","DOI":"10.1145\/3372884.3373160"},{"key":"e_1_3_1_31_1","volume-title":"An Overview of the FLINT\/ML Compiler. Proc. 1997 ACM SIGPLAN Workshop on Types in Compilation (TIC\u201397)","author":"Shao Zhong","year":"1997","unstructured":"Zhong Shao. 1997. An Overview of the FLINT\/ML Compiler. Proc. 1997 ACM SIGPLAN Workshop on Types in Compilation (TIC\u201397), Amsterdam, The Netherlands."},{"key":"e_1_3_1_32_1","doi-asserted-by":"publisher","DOI":"10.1145\/317636.317801"},{"key":"e_1_3_1_33_1","doi-asserted-by":"publisher","DOI":"10.1145\/581690.581691"},{"key":"e_1_3_1_34_1","doi-asserted-by":"publisher","DOI":"10.1145\/3278122.3278139"},{"key":"e_1_3_1_35_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-981-97-2300-3_13"},{"key":"e_1_3_1_36_1","doi-asserted-by":"publisher","DOI":"10.1145\/2847538.2847542"},{"key":"e_1_3_1_37_1","doi-asserted-by":"publisher","DOI":"10.1145\/1159876.1159884"},{"key":"e_1_3_1_38_1","unstructured":"Walid Taha. 1999. Multi-Stage Programming: Its Theory and Applications. Ph. D. Dissertation. Halmstad University Sweden. https:\/\/urn.kb.se\/resolve?urn=urn:nbn:se:hh:diva-15052"},{"key":"e_1_3_1_39_1","doi-asserted-by":"publisher","DOI":"10.1007\/BFb0055113"},{"key":"e_1_3_1_40_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-540-39815-8_6"},{"key":"e_1_3_1_41_1","first-page":"30","volume-title":"Proceedings of the 1999 ACM SIGPLAN Workshop on Partial Evaluation and Semantics-Based Program Manipulation, San Antonio, Texas, USA, January 22-23, 1999. Technical reportBRICS-NS-99-1","author":"Thiemann Peter","year":"1999","unstructured":"Peter Thiemann. 1999. Interpreting Specialization in Type Theory. In Proceedings of the 1999 ACM SIGPLAN Workshop on Partial Evaluation and Semantics-Based Program Manipulation, San Antonio, Texas, USA, January 22-23, 1999. Technical reportBRICS-NS-99-1, Olivier Danvy (Ed.). University of Aarhus, 30\u201343."},{"key":"e_1_3_1_42_1","doi-asserted-by":"publisher","DOI":"10.1145\/3571786.3573017"},{"key":"e_1_3_1_43_1","doi-asserted-by":"publisher","DOI":"10.1145\/3162072"},{"key":"e_1_3_1_44_1","doi-asserted-by":"publisher","DOI":"10.1145\/1159876.1159877"},{"key":"e_1_3_1_45_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-540-89330-1_14"},{"key":"e_1_3_1_46_1","unstructured":"Leo White. 2013. Extension points for OCaml. OCaml Users and Developers Workshop."},{"key":"e_1_3_1_47_1","doi-asserted-by":"publisher","DOI":"10.4204\/EPTCS.198.2"},{"key":"e_1_3_1_48_1","doi-asserted-by":"publisher","DOI":"10.1006\/inco.1994.1093"},{"key":"e_1_3_1_49_1","doi-asserted-by":"publisher","DOI":"10.1145\/3498723"},{"key":"e_1_3_1_50_1","doi-asserted-by":"publisher","DOI":"10.1145\/3607851"},{"key":"e_1_3_1_51_1","doi-asserted-by":"publisher","DOI":"10.1145\/3110273"},{"key":"e_1_3_1_52_1","doi-asserted-by":"publisher","DOI":"10.1016\/J.SCICO.2017.04.002"},{"key":"e_1_3_1_53_1","doi-asserted-by":"publisher","DOI":"10.1145\/3236795"}],"container-title":["Proceedings of the ACM on Programming Languages"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3674649","content-type":"unspecified","content-version":"vor","intended-application":"text-mining"},{"URL":"https:\/\/dl.acm.org\/doi\/pdf\/10.1145\/3674649","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2026,2,4]],"date-time":"2026-02-04T07:49:21Z","timestamp":1770191361000},"score":1,"resource":{"primary":{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3674649"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2024,8,15]]},"references-count":52,"journal-issue":{"issue":"ICFP","published-print":{"date-parts":[[2024,8,15]]}},"alternative-id":["10.1145\/3674649"],"URL":"https:\/\/doi.org\/10.1145\/3674649","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"}}]}}