{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,7,16]],"date-time":"2026-07-16T11:05:00Z","timestamp":1784199900447,"version":"3.55.0"},"reference-count":48,"publisher":"Association for Computing Machinery (ACM)","issue":"PLDI","content-domain":{"domain":["dl.acm.org"],"crossmark-restriction":true},"short-container-title":["Proc. ACM Program. Lang."],"published-print":{"date-parts":[[2025,6,10]]},"abstract":"<jats:p>There is a tension in dynamic language runtime design between speed and correctness. State-of-the-art JIT compilation, the result of enormous industrial investment and significant research, achieves heroic speedups at the cost of complexity. This complexity leads to subtle and sometimes catastrophic correctness bugs. Much of this complexity comes from the existence of multiple tiers and the need to maintain correspondence between these separate definitions of the language\u2019s semantics; it also comes from the indirect nature of the semantics implicitly encoded in a compiler backend. One way to address this complexity is to automatically derive, as much as possible, the compiled code from a single source-of-truth, such as the interpreter tier. In this work, we introduce a partial evaluator that can compile a whole guest-language function ahead-of-time, without tracing or profiling, \u201cfor free.\u201d This transform unrolls an interpreter function expressed in a standard compiler intermediate representation (static single assignment or SSA) and uses partial evaluation of the interpreter function and its regular control flow to drive the guest-language compilation. The effect of this is that the transform is applicable to almost unmodified existing interpreters in systems languages such as C or C++, producing ahead-of-time guest-language compilers. We show the effectiveness of this new tool by applying it to the interpreter tier of an existing industrial JavaScript engine, SpiderMonkey, yielding 2.17\u00d7 speedups, and the PUC-Rio Lua interpreter, yielding 1.84\u00d7 speedups. Finally, we outline an approach to carry this work further, deriving more of the capabilities of a JIT backend from first principles while retaining correctness.<\/jats:p>","DOI":"10.1145\/3729259","type":"journal-article","created":{"date-parts":[[2025,6,13]],"date-time":"2025-06-13T16:02:27Z","timestamp":1749830547000},"page":"324-347","update-policy":"https:\/\/doi.org\/10.1145\/crossmark-policy","source":"Crossref","is-referenced-by-count":1,"title":["Partial Evaluation, Whole-Program Compilation"],"prefix":"10.1145","volume":"9","author":[{"ORCID":"https:\/\/orcid.org\/0000-0002-6733-1803","authenticated-orcid":false,"given":"Chris","family":"Fallin","sequence":"first","affiliation":[{"name":"F5, San Jose, USA"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0003-3130-7059","authenticated-orcid":false,"given":"Maxwell","family":"Bernstein","sequence":"additional","affiliation":[{"name":"Recurse Center, Boston, USA"}],"role":[{"vocabulary":"crossref","role":"author"}]}],"member":"320","published-online":{"date-parts":[[2025,6,13]]},"reference":[{"key":"e_1_3_2_2_2","unstructured":"[n. d.]. WebAssembly exception-handling proposal. https:\/\/github.com\/WebAssembly\/exception-handling\/"},{"key":"e_1_3_2_3_2","unstructured":"[n. d.]. weval GitHub Repository. https:\/\/github.com\/bytecodealliance\/weval\/"},{"key":"e_1_3_2_4_2","unstructured":"2024. CVE-2024-4761. https:\/\/cve.mitre.org\/cgi-bin\/cvename.cgi?name=CVE-2024-4761"},{"key":"e_1_3_2_5_2","unstructured":"2024. SpiderMonkey JavaScript Engine. https:\/\/spidermonkey.dev\/."},{"key":"e_1_3_2_6_2","unstructured":"2025. Truffle AOT Tutorial. https:\/\/www.graalvm.org\/latest\/graalvm-as-a-platform\/language-implementation-framework\/AOT\/"},{"key":"e_1_3_2_7_2","volume-title":"Compilers: principles, techniques, and tools","author":"Aho A. V.","year":"2006","unstructured":"A. V. Aho, M. S. Lam, R. Sethi, and J. D. Ullman. 2006. Compilers: principles, techniques, and tools, 2nd ed. Addison Wesley.","edition":"2"},{"key":"e_1_3_2_8_2","unstructured":"Bytecode Alliance. [n. d.]. Wasmtime WebAssembly virtual machine. https:\/\/wasmtime.dev"},{"key":"e_1_3_2_9_2","unstructured":"Bytecode Alliance. 2024. StarlingMonkey JavaScript Runtime. https:\/\/github.com\/bytecodealliance\/starlingmonkey"},{"key":"e_1_3_2_10_2","doi-asserted-by":"publisher","DOI":"10.1145\/3357390.3361032"},{"key":"e_1_3_2_11_2","unstructured":"Zach Bloom. 2018. Cloud Computing without Containers. https:\/\/blog.cloudflare.com\/cloud-computing-without-containers\/"},{"key":"e_1_3_2_12_2","doi-asserted-by":"publisher","unstructured":"C F Bolz A Cuni M Fijalkowski and A Rigo. 2009. Tracing the meta-level: PyPy\u2019s tracing JIT compiler. ICOOOLPS (2009). https:\/\/doi.org\/10.1145\/1565824.1565827 10.1145\/1565824.1565827","DOI":"10.1145\/1565824.1565827"},{"key":"e_1_3_2_13_2","unstructured":"CF Bolz-Tereick. 2024. A Knownbits Abstract Domain for the Toy Optimizer Correctly. https:\/\/pypy.org\/posts\/2024\/08\/toy-knownbits.html"},{"key":"e_1_3_2_14_2","doi-asserted-by":"publisher","unstructured":"Ajay Brahmakshatriya and Saman Amarasinghe. 2021. BuildIt: A Type-Based Multi-stage Programming Framework for Code Generation in C++. In 2021 IEEE\/ACM International Symposium on Code Generation and Optimization (CGO). 39\u201351. https:\/\/doi.org\/10.1109\/CGO51591.2021.9370333 10.1109\/CGO51591.2021.9370333","DOI":"10.1109\/CGO51591.2021.9370333"},{"key":"e_1_3_2_15_2","doi-asserted-by":"publisher","unstructured":"M. Chevalier-Boisvert and M. Feeley. 2015. Simple and Effective Type Check Removal through Lazy Basic Block Versioning. ECOOP (2015). https:\/\/doi.org\/10.4230\/LIPIcs.ECOOP.2015.101 10.4230\/LIPIcs.ECOOP.2015.101","DOI":"10.4230\/LIPIcs.ECOOP.2015.101"},{"key":"e_1_3_2_16_2","unstructured":"L Clark. 2021. Making JavaScript Run Fast on WebAssembly. https:\/\/bytecodealliance.org\/articles\/making-javascriptrun-fast-on-webassembly."},{"key":"e_1_3_2_17_2","unstructured":"J de Mooij. 2020. Warp: Improved JS performance in Firefox 83. https:\/\/hacks.mozilla.org\/2020\/11\/warp-improved-js-performance-in-firefox-83\/"},{"key":"e_1_3_2_18_2","doi-asserted-by":"publisher","DOI":"10.1145\/3617651.3622979"},{"key":"e_1_3_2_19_2","unstructured":"C Fallin. 2023. Fast(er) JavaScript on WebAssembly: Portable Baseline Interpreter and Future Plans. https:\/\/cfallin.org\/blog\/2023\/10\/11\/spidermonkey-pbl\/"},{"key":"e_1_3_2_20_2","unstructured":"N Fitzgerald. 2020. Wizer: The WebAssembly Pre-initializer. https:\/\/github.com\/bytecodealliance\/wizer."},{"key":"e_1_3_2_21_2","unstructured":"N Fitzgerald. 2023. The Winliner WebAssembly indirect call inliner. https:\/\/github.com\/fitzgen\/winliner"},{"key":"e_1_3_2_22_2","first-page":"5","article-title":"Partial Evaluation of Computation Process \u2013 An Approach to a Compiler-Compiler","volume":"2","author":"Futamura Y","year":"1971","unstructured":"Y Futamura. 1971. Partial Evaluation of Computation Process \u2013 An Approach to a Compiler-Compiler. Systems.Computers.Controls 2, 5 (1971).","journal-title":"Systems.Computers.Controls"},{"key":"e_1_3_2_23_2","doi-asserted-by":"publisher","DOI":"10.1023\/A:1010095604496"},{"key":"e_1_3_2_24_2","doi-asserted-by":"publisher","unstructured":"A Gal B Eich M Shaver D Anderson D Mandelin M R Haghighat B Kaplan G Hoare B Zbarsky J Orendorff J Ruderman E W Smith R Reitmaier M Bebenita M Chang and M Franz. 2009. Trace-based just-in-time type specialization for dynamic languages. PLDI (2009). https:\/\/doi.org\/10.1145\/1542476.1542528 10.1145\/1542476.1542528","DOI":"10.1145\/1542476.1542528"},{"key":"e_1_3_2_25_2","doi-asserted-by":"publisher","unstructured":"Brian Grant Markus Mock Matthai Philipose Craig Chambers and Susan J. Eggers. 2000. DyC: an expressive annotation-directed dynamic compiler for C. Theor. Comput. Sci. 248 1\u20132 (Oct. 2000) 147\u2013199. https:\/\/doi.org\/10.1016\/S0304-3975(00)00051-7 10.1016\/S0304-3975(00)00051-7","DOI":"10.1016\/S0304-3975(00)00051-7"},{"key":"e_1_3_2_26_2","doi-asserted-by":"publisher","DOI":"10.1145\/301618.301683"},{"key":"e_1_3_2_27_2","unstructured":"Samuel Gro\u00df. 2021. V8 Sandbox \u2013 High-Level Design Doc. https:\/\/docs.google.com\/document\/d\/1FM4fQmIhEqPG8uGp5o9A-mnPB5BOeScZYpkHjo0KKA8"},{"key":"e_1_3_2_28_2","doi-asserted-by":"publisher","unstructured":"A Haas A Rossberg D L Schuff B L Titzer M Holman D Gohman L Wagner A Zakai and JF Bastien. 2017. Bringing the Web Up To Speed with WebAssembly. PLDI (2017). https:\/\/doi.org\/10.1145\/3062341.3062363 10.1145\/3062341.3062363","DOI":"10.1145\/3062341.3062363"},{"key":"e_1_3_2_29_2","doi-asserted-by":"publisher","DOI":"10.1007\/BFb0032064"},{"key":"e_1_3_2_30_2","doi-asserted-by":"publisher","DOI":"10.1145\/243439.243447"},{"key":"e_1_3_2_31_2","doi-asserted-by":"publisher","unstructured":"C. Lattner and V. Adve. 2004. LLVM: A compilation framework for lifelong program analysis & transformation. CGO (2004). https:\/\/doi.org\/10.1109\/CGO.2004.1281665 10.1109\/CGO.2004.1281665","DOI":"10.1109\/CGO.2004.1281665"},{"key":"e_1_3_2_32_2","unstructured":"Oliver Medhurst. [n. d.]. Porffor: A from-scratch experimental AOT JS engine written in JS. https:\/\/github.com\/CanadaHonk\/porffor"},{"key":"e_1_3_2_33_2","doi-asserted-by":"publisher","unstructured":"Olivier Melan\u00e7on Marc Feeley and Manuel Serrano. 2023. An Executable Semantics for Faster Development of Optimizing Python Compilers. In Proceedings of the 16th ACM SIGPLAN International Conference on Software Language Engineering (Cascais Portugal) (SLE 2023). Association for Computing Machinery New York NY USA 15\u201328. https:\/\/doi.org\/10.1145\/3623476.3623529 10.1145\/3623476.3623529","DOI":"10.1145\/3623476.3623529"},{"key":"e_1_3_2_34_2","doi-asserted-by":"publisher","unstructured":"Olivier Melan\u00e7on Marc Feeley and Manuel Serrano. 2024. Static Basic Block Versioning. In 38th European Conference on Object-Oriented Programming (ECOOP 2024) (Leibniz International Proceedings in Informatics (LIPIcs) Vol. 313) Jonathan Aldrich and Guido Salvaneschi (Eds.). Schloss Dagstuhl \u2013 Leibniz-Zentrum f\u00fcr Informatik Dagstuhl Germany 28:1\u201328:27. https:\/\/doi.org\/10.4230\/LIPIcs.ECOOP.2024.28 10.4230\/LIPIcs.ECOOP.2024.28","DOI":"10.4230\/LIPIcs.ECOOP.2024.28"},{"key":"e_1_3_2_35_2","unstructured":"Tzvetan Mikov. 2023. Static Hermes: How to Speed Up a Micro-benchmark by 300x Without Cheating. https:\/\/tmikov.blogspot.com\/2023\/09\/how-to-speed-up-micro-benchmark-300x.html"},{"key":"e_1_3_2_36_2","doi-asserted-by":"publisher","DOI":"10.1145\/3475061.3475077"},{"key":"e_1_3_2_37_2","unstructured":"Johnathan Norman. 2021. Microsoft Edge: Super Duper Secure Mode. https:\/\/microsoftedge.github.io\/edgevr\/posts\/Super-Duper-Secure-Mode\/"},{"key":"e_1_3_2_38_2","unstructured":"V8 Project. [n. d.]. Octane Benchmark Suite. http:\/\/chromium.github.io\/octane\/"},{"key":"e_1_3_2_39_2","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-319-30936-1_17"},{"key":"e_1_3_2_40_2","doi-asserted-by":"publisher","unstructured":"Tiark Rompf and Martin Odersky. 2010. Lightweight modular staging: a pragmatic approach to runtime code generation and compiled DSLs. SIGPLAN Not. 46 2 (Oct. 2010) 127\u2013136. https:\/\/doi.org\/10.1145\/1942788.1868314 10.1145\/1942788.1868314","DOI":"10.1145\/1942788.1868314"},{"key":"e_1_3_2_41_2","doi-asserted-by":"publisher","DOI":"10.1145\/3381052.3381325"},{"key":"e_1_3_2_42_2","unstructured":"Chris Seaton. 2015. Specialising Dynamic Techniques for Implementing The Ruby Programming Language. PhD thesis University of Manchester."},{"key":"e_1_3_2_43_2","doi-asserted-by":"publisher","unstructured":"Manuel Serrano. 2018. JavaScript AOT compilation. In Proceedings of the 14th ACM SIGPLAN International Symposium on Dynamic Languages (Boston MA USA) (DLS 2018). Association for Computing Machinery New York NY USA 50\u201363. https:\/\/doi.org\/10.1145\/3276945.3276950 10.1145\/3276945.3276950","DOI":"10.1145\/3276945.3276950"},{"key":"e_1_3_2_44_2","doi-asserted-by":"publisher","DOI":"10.1145\/3473575"},{"key":"e_1_3_2_45_2","doi-asserted-by":"publisher","unstructured":"Amir Shaikhha Yannis Klonatos and Christoph Koch. 2018. Building Efficient Query Engines in a High-Level Language. ACM Trans. Database Syst. 43 1 Article 4 (April 2018) 45 pages. https:\/\/doi.org\/10.1145\/3183653 10.1145\/3183653","DOI":"10.1145\/3183653"},{"key":"e_1_3_2_46_2","doi-asserted-by":"publisher","unstructured":"Harishankar Vishwanathan Matan Shachnai Srinivas Narayana and Santosh Nagarakatte. 2022. Sound Precise and Fast Abstract Interpretation with Tristate Numbers. In 2022 IEEE\/ACM International Symposium on Code Generation and Optimization (CGO). 254\u2013265. https:\/\/doi.org\/10.1109\/CGO53902.2022.9741267 10.1109\/CGO53902.2022.9741267","DOI":"10.1109\/CGO53902.2022.9741267"},{"key":"e_1_3_2_47_2","unstructured":"WebAssembly. [n. d.]. Binaryen: optimizer and compiler\/toolchain library for WebAssembly. https:\/\/github.com\/WebAssembly\/binaryen"},{"key":"e_1_3_2_48_2","doi-asserted-by":"publisher","unstructured":"T W\u00fcrthinger C Wimmer C Humer A W\u00f6\u00df L Stadler C Seaton G Duboscq D Simon and M Grimmer. 2017. Practical Partial Evaluation for High-Performance Dynamic Language Runtimes. PLDI (2017). https:\/\/doi.org\/10.1145\/3062341.3062381 10.1145\/3062341.3062381","DOI":"10.1145\/3062341.3062381"},{"key":"e_1_3_2_49_2","doi-asserted-by":"publisher","unstructured":"Haoran Xu and Fredrik Kjolstad. 2024. Deegen: A JIT-Capable VM Generator for Dynamic Languages. https:\/\/doi.org\/10.48550\/arXiv.2411.11469 10.48550\/arXiv.2411.11469 arXiv:2411.11469 [cs.PL]","DOI":"10.48550\/arXiv.2411.11469"}],"container-title":["Proceedings of the ACM on Programming Languages"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/dl.acm.org\/doi\/pdf\/10.1145\/3729259","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2026,7,16]],"date-time":"2026-07-16T10:04:56Z","timestamp":1784196296000},"score":1,"resource":{"primary":{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3729259"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2025,6,10]]},"references-count":48,"journal-issue":{"issue":"PLDI","published-print":{"date-parts":[[2025,6,10]]}},"alternative-id":["10.1145\/3729259"],"URL":"https:\/\/doi.org\/10.1145\/3729259","relation":{},"ISSN":["2475-1421"],"issn-type":[{"value":"2475-1421","type":"electronic"}],"subject":[],"published":{"date-parts":[[2025,6,10]]},"assertion":[{"value":"2024-11-11","order":0,"name":"received","label":"Received","group":{"name":"publication_history","label":"Publication History"}},{"value":"2025-03-06","order":2,"name":"accepted","label":"Accepted","group":{"name":"publication_history","label":"Publication History"}},{"value":"2025-06-13","order":3,"name":"published","label":"Published","group":{"name":"publication_history","label":"Publication History"}}]}}