{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,9,30]],"date-time":"2026-09-30T10:36:32Z","timestamp":1790764592953,"version":"4.1.0"},"reference-count":83,"publisher":"Association for Computing Machinery (ACM)","issue":"OOPSLA","license":[{"start":{"date-parts":[[2017,10,12]],"date-time":"2017-10-12T00:00:00Z","timestamp":1507766400000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/www.acm.org\/publications\/policies\/copyright_policy#Background"}],"content-domain":{"domain":["dl.acm.org"],"crossmark-restriction":true},"short-container-title":["Proc. ACM Program. Lang."],"published-print":{"date-parts":[[2017,10,12]]},"abstract":"<jats:p>Heterogeneous hardware is central to modern advances in performance and efficiency. Mainstream programming models for heterogeneous architectures, however, sacrifice safety and expressiveness in favor of low-level control over performance details. The interfaces between hardware units consist of verbose, unsafe APIs; hardware-specific languages make it difficult to move code between units; and brittle preprocessor macros complicate the task of specializing general code for efficient accelerated execution. We propose a unified low-level programming model for heterogeneous systems that offers control over performance, safe communication constructs, cross-device code portability, and hygienic metaprogramming for specialization. The language extends constructs from multi-stage programming to separate code for different hardware units, to communicate between them, and to express compile-time code optimization. We introduce static staging, a different take on multi-stage programming that lets the compiler generate all code and communication constructs ahead of time.<\/jats:p>\n                  <jats:p>To demonstrate our approach, we use static staging to implement BraidGL, a real-time graphics programming language for CPU-GPU systems. Current real-time graphics software in OpenGL uses stringly-typed APIs for communication and unsafe preprocessing to generate specialized GPU code variants. In BraidGL, programmers instead write hybrid CPU-GPU software in a unified language. The compiler statically generates target-specific code and guarantees safe communication between the CPU and the graphics pipeline stages. Example scenes demonstrate the language's productivity advantages: BraidGL eliminates the safety and expressiveness pitfalls of OpenGL and makes common specialization techniques easy to apply. The case study demonstrates how static staging can express core placement and specialization in general heterogeneous programming.<\/jats:p>","DOI":"10.1145\/3133895","type":"journal-article","created":{"date-parts":[[2017,10,13]],"date-time":"2017-10-13T11:15:45Z","timestamp":1507893345000},"page":"1-27","update-policy":"https:\/\/doi.org\/10.1145\/crossmark-policy","source":"Crossref","is-referenced-by-count":10,"title":["Static stages for heterogeneous programming"],"prefix":"10.1145","volume":"1","author":[{"given":"Adrian","family":"Sampson","sequence":"first","affiliation":[{"name":"Cornell University, USA"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Kathryn S.","family":"McKinley","sequence":"additional","affiliation":[{"name":"Google, USA"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Todd","family":"Mytkowicz","sequence":"additional","affiliation":[{"name":"Microsoft Research, USA"}],"role":[{"vocabulary":"crossref","role":"author"}]}],"member":"320","published-online":{"date-parts":[[2017,10,12]]},"reference":[{"key":"e_1_2_2_1_1","unstructured":"Advanced Micro Devices. Mantle Programming Guide and API Reference 1.0. https:\/\/www.amd.com\/Documents\/ Mantle- Programming- Guide- and- API- Reference.pdf ."},{"key":"e_1_2_2_2_1","doi-asserted-by":"publisher","DOI":"10.1145\/1542476.1542481"},{"key":"e_1_2_2_3_1","unstructured":"Apple. Metal Shading Language Specification Version 2.0. https:\/\/developer.apple.com\/metal\/ Metal- Shading- Language- Specification.pdf ."},{"key":"e_1_2_2_4_1","doi-asserted-by":"publisher","DOI":"10.1145\/1869459.1869469"},{"key":"e_1_2_2_5_1","doi-asserted-by":"publisher","DOI":"10.31274\/rtd-20201107-9"},{"key":"e_1_2_2_6_1","unstructured":"Baggers. Varjo: Lisp to GLSL Language Translator. https:\/\/github.com\/cbaggers\/varjo ."},{"key":"e_1_2_2_7_1","volume-title":"Quasiquotation in Lisp. In ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation (PEPM).","author":"Bawden Alan","year":"1999","unstructured":"Alan Bawden. 1999. Quasiquotation in Lisp. In ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation (PEPM)."},{"key":"e_1_2_2_8_1","volume-title":"Logical Modalities and Multi-Stage Programming. In Federated Logic Conference (FLoC) Satellite Workshop on Intuitionistic Modal Logics and Applications (IMLA).","author":"Benaissa El-Abidine","year":"1999","unstructured":"Zine-El-Abidine Benaissa, Eugenio Moggi, Walid Taha, and Tim Sheard. 1999. Logical Modalities and Multi-Stage Programming. In Federated Logic Conference (FLoC) Satellite Workshop on Intuitionistic Modal Logics and Applications (IMLA)."},{"key":"e_1_2_2_9_1","unstructured":"Tobias Bexelius. GPipe. http:\/\/hackage.haskell.org\/package\/GPipe ."},{"key":"e_1_2_2_10_1","unstructured":"Kovas Boguta. Gamma. https:\/\/github.com\/kovasb\/gamma ."},{"key":"e_1_2_2_11_1","doi-asserted-by":"publisher","DOI":"10.1109\/PACT.2011.15"},{"key":"e_1_2_2_12_1","doi-asserted-by":"publisher","DOI":"10.1017\/S0956796802004598"},{"key":"e_1_2_2_13_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-540-24725-8_7"},{"key":"e_1_2_2_14_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-540-39815-8_4"},{"key":"e_1_2_2_15_1","volume-title":"ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming (PPoPP).","author":"Chafi Hassan","unstructured":"Hassan Chafi, Arvind K. Sujeeth, Kevin J. Brown, HyoukJoong Lee, Anand R. Atreya, and Kunle Olukotun. 2011. A Domainspecific Approach to Heterogeneous Parallelism. In ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming (PPoPP)."},{"key":"e_1_2_2_16_1","doi-asserted-by":"publisher","DOI":"10.1177\/1094342007078442"},{"key":"e_1_2_2_17_1","doi-asserted-by":"publisher","DOI":"10.1145\/1094811.1094852"},{"key":"e_1_2_2_18_1","doi-asserted-by":"publisher","DOI":"10.1145\/944705.944730"},{"key":"e_1_2_2_19_1","doi-asserted-by":"publisher","DOI":"10.1145\/2500365.2500586"},{"key":"e_1_2_2_20_1","doi-asserted-by":"publisher","unstructured":"Rowan Davies and Frank Pfenning. 1996. A Modal Analysis of Staged Computation. In ACM SIGPLAN\u2013SIGACT Symposium on Principles of Programming Languages (POPL). 10.1145\/237721.237788","DOI":"10.1145\/237721.237788"},{"key":"e_1_2_2_21_1","doi-asserted-by":"publisher","DOI":"10.1145\/2491956.2462166"},{"key":"e_1_2_2_22_1","doi-asserted-by":"publisher","DOI":"10.1007\/s00354-007-0020-x"},{"key":"e_1_2_2_23_1","doi-asserted-by":"publisher","DOI":"10.1145\/1017472.1017482"},{"key":"e_1_2_2_24_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-662-49498-1_11"},{"key":"e_1_2_2_25_1","doi-asserted-by":"publisher","DOI":"10.1145\/581478.581486"},{"key":"e_1_2_2_26_1","doi-asserted-by":"publisher","unstructured":"Matthew Flatt. 2016. Binding As Sets of Scopes. In ACM SIGPLAN\u2013SIGACT Symposium on Principles of Programming Languages (POPL). 10.1145\/2837614.2837620","DOI":"10.1145\/2837614.2837620"},{"key":"e_1_2_2_27_1","volume-title":"Spark: Modular, Composable Shaders for Graphics Hardware. In SIGGRAPH.","author":"Foley Tim","year":"2011","unstructured":"Tim Foley and Pat Hanrahan. 2011. Spark: Modular, Composable Shaders for Graphics Hardware. In SIGGRAPH."},{"key":"e_1_2_2_28_1","doi-asserted-by":"publisher","DOI":"10.1145\/507635.507646"},{"key":"e_1_2_2_29_1","unstructured":"Kate Gregory and Ade Miller. 2012. C++ AMP: Accelerated Massive Parallelism with Microsoft Visual C++. O\u2019Reilly. http:\/\/www.gregcons.com\/cppamp\/"},{"key":"e_1_2_2_30_1","unstructured":"Ilya Grigorik James Simonsen and Jatinder Mann. High Resolution Time Level 2: W3C Working Draft. https:\/\/www.w3. org\/TR\/hr- time\/ ."},{"key":"e_1_2_2_31_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-319-07151-0_7"},{"key":"e_1_2_2_32_1","doi-asserted-by":"publisher","DOI":"10.1145\/2749469.2749472"},{"key":"e_1_2_2_33_1","doi-asserted-by":"publisher","unstructured":"Yong He Tim Foley and Kayvon Fatahalian. 2016. A System for Rapid Exploration of Shader Optimization Choices. In SIGGRAPH. 10.1145\/2897824.2925923","DOI":"10.1145\/2897824.2925923"},{"key":"e_1_2_2_34_1","unstructured":"Yong He Tim Foley Natalya Tatarchuk and Kayvon Fatahalian. 2015. A System for Rapid Automatic Shader Level-of-detail. In SIGGRAPH Asia."},{"key":"e_1_2_2_35_1","doi-asserted-by":"publisher","DOI":"10.1145\/3062341.3062354"},{"key":"e_1_2_2_36_1","doi-asserted-by":"publisher","DOI":"10.1145\/1297027.1297030"},{"key":"e_1_2_2_37_1","unstructured":"Lee Howes and Maria Rovatsou. SYCL Specification. https:\/\/www.khronos.org\/registry\/sycl\/ ."},{"key":"e_1_2_2_38_1","unstructured":"Dean Jackson and Jeff Gilbert. WebGL Specification. https:\/\/www.khronos.org\/registry\/webgl\/specs\/latest\/1.0\/ ."},{"key":"e_1_2_2_39_1","doi-asserted-by":"publisher","DOI":"10.1145\/512644.512652"},{"key":"e_1_2_2_40_1","doi-asserted-by":"publisher","DOI":"10.1145\/3079856.3080246"},{"key":"e_1_2_2_41_1","unstructured":"John Kessenich. An Introduction to SPIR-V: A Khronos-Defined Intermediate Language for Native Representation of Graphical Shaders and Compute Kernels. https:\/\/www.khronos.org\/registry\/spir- v\/papers\/WhitePaper.pdf ."},{"key":"e_1_2_2_42_1","unstructured":"Khronos. Vulkan 1.0.48: A Specification. https:\/\/www.khronos.org\/registry\/vulkan\/specs\/1.0\/pdf\/vkspec.pdf ."},{"key":"e_1_2_2_43_1","doi-asserted-by":"publisher","unstructured":"Ik-Soon Kim Kwangkeun Yi and Cristiano Calcagno. 2006. A Polymorphic Modal Type System for Lisp-like Multi-staged Languages. In ACM SIGPLAN\u2013SIGACT Symposium on Principles of Programming Languages (POPL). 10.1145\/1111037.1111060","DOI":"10.1145\/1111037.1111060"},{"key":"e_1_2_2_44_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-319-07151-0_6"},{"key":"e_1_2_2_45_1","unstructured":"Oleg Kiselyov. MetaOCaml \u2013 an OCaml dialect for multi-stage programming. http:\/\/okmij.org\/ftp\/ML\/MetaOCaml.html ."},{"key":"e_1_2_2_46_1","doi-asserted-by":"publisher","DOI":"10.1145\/2627373.2627387"},{"key":"e_1_2_2_47_1","doi-asserted-by":"publisher","DOI":"10.1016\/j.parco.2011.09.001"},{"key":"e_1_2_2_48_1","doi-asserted-by":"publisher","DOI":"10.1145\/319838.319859"},{"key":"e_1_2_2_49_1","unstructured":"LambdaCube. LambdaCube 3D. http:\/\/lambdacube3d.com ."},{"key":"e_1_2_2_50_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-642-31057-7_26"},{"key":"e_1_2_2_51_1","doi-asserted-by":"publisher","DOI":"10.1145\/1669112.1669121"},{"key":"e_1_2_2_52_1","doi-asserted-by":"publisher","DOI":"10.1145\/2364527.2364572"},{"key":"e_1_2_2_53_1","unstructured":"David Majda. PEG.js: Parser Generator for JavaScript. http:\/\/pegjs.org ."},{"key":"e_1_2_2_54_1","doi-asserted-by":"publisher","DOI":"10.1145\/1186562.1015801"},{"key":"e_1_2_2_55_1","volume-title":"Shader Metaprogramming. In ACM SIGGRAPH\/EUROGRAPHICS Conference on Graphics Hardware.","author":"McCool Michael","unstructured":"Michael McCool, Zheng Qin, and Tiberiu S. Popa. 2002. Shader Metaprogramming. In ACM SIGGRAPH\/EUROGRAPHICS Conference on Graphics Hardware."},{"key":"e_1_2_2_56_1","unstructured":"Sean McDirmid. Two Lightweight DSLs for Rich UI Programming. http:\/\/research.microsoft.com\/pubs\/191794\/ldsl09.pdf ."},{"key":"e_1_2_2_57_1","unstructured":"Morgan McGuire. Computer Graphics Archive. http:\/\/graphics.cs.williams.edu\/data ."},{"key":"e_1_2_2_58_1","unstructured":"Microsoft. Direct3D. https:\/\/msdn.microsoft.com\/en- us\/library\/windows\/desktop\/hh309466(v=vs.85).aspx ."},{"key":"e_1_2_2_59_1","doi-asserted-by":"publisher","DOI":"10.1007\/3-540-49099-X_13"},{"key":"e_1_2_2_60_1","volume-title":"Conference on Trustworthy Global Computing (TGC).","author":"Murphy Tom","year":"2007","unstructured":"Tom Murphy, VII, Karl Crary, and Robert Harper. 2007. Type-safe Distributed Programming with ML5. In Conference on Trustworthy Global Computing (TGC)."},{"key":"e_1_2_2_61_1","doi-asserted-by":"publisher","DOI":"10.1145\/2618395"},{"key":"e_1_2_2_62_1","doi-asserted-by":"publisher","DOI":"10.1145\/2847538.2847541"},{"key":"e_1_2_2_63_1","doi-asserted-by":"publisher","DOI":"10.1017\/S095679680500568X"},{"key":"e_1_2_2_64_1","doi-asserted-by":"publisher","DOI":"10.1145\/1365490.1365500"},{"key":"e_1_2_2_65_1","unstructured":"OpenACC. The OpenACC Application Programming Interface. http:\/\/www.openacc.org\/sites\/default\/files\/OpenACC_2pt5. pdf ."},{"key":"e_1_2_2_66_1","doi-asserted-by":"publisher","DOI":"10.1145\/360825.360839"},{"key":"e_1_2_2_67_1","doi-asserted-by":"publisher","DOI":"10.1145\/2451116.2451162"},{"key":"e_1_2_2_68_1","doi-asserted-by":"publisher","unstructured":"Kekoa Proudfoot William R. Mark Svetoslav Tzvetkov and Pat Hanrahan. 2001. A Real-time Procedural Shading System for Programmable Graphics Hardware. In SIGGRAPH. 10.1145\/383259.383275","DOI":"10.1145\/383259.383275"},{"key":"e_1_2_2_69_1","doi-asserted-by":"publisher","DOI":"10.1109\/ISCA.2014.6853195"},{"key":"e_1_2_2_70_1","doi-asserted-by":"publisher","DOI":"10.1145\/2491956.2462176"},{"key":"e_1_2_2_71_1","doi-asserted-by":"publisher","DOI":"10.1145\/1868294.1868314"},{"key":"e_1_2_2_72_1","volume-title":"Surgical Precision JIT Compilers. In ACM Conference on Programming Language Design and Implementation (PLDI).","author":"Rompf Tiark","year":"2014","unstructured":"Tiark Rompf, Arvind K. Sujeeth, Kevin J. Brown, HyoukJoong Lee, Hassan Chafi, and Kunle Olukotun. 2014. Surgical Precision JIT Compilers. In ACM Conference on Programming Language Design and Implementation (PLDI)."},{"key":"e_1_2_2_73_1","unstructured":"Adrian Sampson. Braid source code documentation and interactive compiler. https:\/\/capra.cs.cornell.edu\/braid\/ ."},{"key":"e_1_2_2_74_1","unstructured":"Ben Sander Greg Stoner Siu-Chi Chan Wen-Heng Chung and Robin Maffeo. HCC: A C++ Compiler For Heterogeneous Computing. http:\/\/www.open- std.org\/jtc1\/sc22\/wg21\/docs\/papers\/2015\/p0069r0.pdf ."},{"key":"e_1_2_2_75_1","unstructured":"Carlos Scheidegger. Lux: the DSEL for WebGL graphics. http:\/\/cscheid.github.io\/lux\/ ."},{"key":"e_1_2_2_76_1","unstructured":"Mark Segal and Kurt Akeley. The OpenGL 4.5 Graphics System: A Specification. https:\/\/www.opengl.org\/registry\/doc\/ glspec45.core.pdf ."},{"key":"e_1_2_2_77_1","unstructured":"Stanford. The Stanford 3D Scanning Repository. http:\/\/graphics.stanford.edu\/data\/3Dscanrep\/ ."},{"key":"e_1_2_2_78_1","volume-title":"OpenCL: A Parallel Programming Standard for Heterogeneous Computing Systems","author":"Stone John E.","year":"2010","unstructured":"John E. Stone, David Gohara, and Guochun Shi. 2010. OpenCL: A Parallel Programming Standard for Heterogeneous Computing Systems. IEEE Design &amp; Test 12, 3 (May 2010), 66\u201373."},{"key":"e_1_2_2_79_1","first-page":"2003","article-title":"Domain-Specific Program Generation: International Seminar, Dagstuhl Castle, Germany","volume":"23","author":"Taha Walid","year":"2003","unstructured":"Walid Taha. 2003. Domain-Specific Program Generation: International Seminar, Dagstuhl Castle, Germany, March 23\u201328, 2003. Revised Papers. Chapter A Gentle Introduction to Multi-stage Programming, 30\u201350.","journal-title":"March"},{"key":"e_1_2_2_80_1","doi-asserted-by":"publisher","unstructured":"Walid Taha and Michael Florentin Nielsen. 2003. Environment Classifiers. In ACM SIGPLAN\u2013SIGACT Symposium on Principles of Programming Languages (POPL). 10.1145\/604131.604134","DOI":"10.1145\/604131.604134"},{"key":"e_1_2_2_81_1","doi-asserted-by":"publisher","DOI":"10.1145\/258993.259019"},{"key":"e_1_2_2_82_1","doi-asserted-by":"publisher","DOI":"10.1145\/2808091.2808096"},{"key":"e_1_2_2_83_1","unstructured":"Web Hypertext Application Technology Working Group. HTML Living Standard. Section 8.9: Animation Frames. https:\/\/html.spec.whatwg.org\/multipage\/webappapis.html ."}],"container-title":["Proceedings of the ACM on Programming Languages"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3133895","content-type":"unspecified","content-version":"vor","intended-application":"text-mining"},{"URL":"https:\/\/dl.acm.org\/doi\/pdf\/10.1145\/3133895","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2026,9,10]],"date-time":"2026-09-10T16:11:30Z","timestamp":1789056690000},"score":1,"resource":{"primary":{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3133895"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2017,10,12]]},"references-count":83,"journal-issue":{"issue":"OOPSLA","published-print":{"date-parts":[[2017,10,12]]}},"alternative-id":["10.1145\/3133895"],"URL":"https:\/\/doi.org\/10.1145\/3133895","relation":{},"ISSN":["2475-1421"],"issn-type":[{"value":"2475-1421","type":"electronic"}],"subject":[],"published":{"date-parts":[[2017,10,12]]},"assertion":[{"value":"2017-10-12","order":3,"name":"published","label":"Published","group":{"name":"publication_history","label":"Publication History"}}]}}