Abstract
This paper investigates shallow embedding of DSLs by means of online partial evaluation. To this end, we present a novel online partial evaluator for continuation-passing style languages. We argue that it has, in contrast to prior work, a predictable termination policy that works well in practice. We present our approach formally using a continuation-passing variant of PCF and prove its termination properties. We evaluate our technique experimentally in the field of visual and high-performance computing and show that our evaluator produces highly specialized and efficient code for CPUs as well as GPUs that matches the performance of hand-tuned expert code.
- L. O. Andersen. Program Analysis and Specialization for the C Programming Language. PhD thesis, University of Copenhagen, 1994.Google Scholar
- L. Birkedal and M. Welinder. Hand-writing program generator generators. In PLILP, 1994. Google Scholar
Digital Library
- A. Bondorf and J. Jørgensen. E fficient analyses for realistic off-line partial evaluation. JFP, 1993.Google Scholar
- W. L. Briggs, H. Van Emden, and S. F. McCormick. A Multigrid Tutorial, volume 2. SIAM, June 2000. Google Scholar
Digital Library
- K. J. Brown, A. K. Sujeeth, H. J. Lee, T. Rompf, H. Chafi, M. Odersky, and K. Olukotun. A heterogeneous parallel framework for domain-specific languages. In PACT, 2011. Google Scholar
Digital Library
- J. Carette, O. Kiselyov, and C.-C. Shan. Finally tagless, partially evaluated: Tagless staged interpreters for simpler typed languages. In APLAS, 2007. Google Scholar
Digital Library
- H. Chafi, Z. DeVito, A. Moors, T. Rompf, A. K. Sujeeth, P. Hanrahan, M. Odersky, and K. Olukotun. Language virtualization for heterogeneous parallel computing. In OOPSLA, 2010. Google Scholar
Digital Library
- C. Consel. A tour of Schism: a partial evaluation system for higher-order applicative languages. In PEPM, 1993. Google Scholar
Digital Library
- W. R. Cook and R. Lämmel. Tutorial on online partial evaluation. In DSL, 2011.Google Scholar
Cross Ref
- K. Czarnecki, J. O’Donnell, J. Striegnitz, and W. Taha. DSL implementation in MetaOCaml, Template Haskell, and C ++. In Domain-Specific Program Generation, 2004.Google Scholar
Cross Ref
- P. Danilewski, M. Köster, R. Leißa, R. Membarth, and P. Slusallek. Specialization through dynamic staging. In GPCE, 2014. Google Scholar
Digital Library
- Z. DeVito, N. Joubert, F. Palacios, S. Oakley, M. Medina, M. Barrientos, E. Elsen, F. Ham, A. Aiken, K. Duraisamy, E. Darve, J. Alonso, and P. Hanrahan. Liszt: a domain specific language for building portable mesh-based PDE solvers. In SC, 2011. Google Scholar
Digital Library
- Z. DeVito, J. Hegarty, A. Aiken, P. Hanrahan, and J. Vitek. Terra: A multi-stage language for high-performance computing. In PLDI, 2013. Google Scholar
Digital Library
- Y. Futamura. Partial evaluation of computation process—an approach to a compiler-compiler. Systems, Computers, Controls, 1999. Reproduction of the 1971 paper.Google Scholar
- J. Gibbons and N. Wu. Folding domain-specific languages: Deep and shallow embeddings. In ICFP, 2014. Google Scholar
Digital Library
- R. Glück. A self-applicable online partial evaluator for recursive flowchart languages. Softw., Pract. Exper., 42, 2012. Google Scholar
Digital Library
- C. Hofer, K. Ostermann, T. Rendel, and A. Moors. Polymorphic embedding of DSLs. In GPCE, 2008. Google Scholar
Digital Library
- B. T. Howard and J. C. Mitchell. Operational and axiomatic semantics of pcf. In LFP, 1990. Google Scholar
Digital Library
- P. Hudak. Modular domain specific languages and tools. In Software Reuse, 1998. Google Scholar
Digital Library
- T. Johnsson. Lambda lifting: Transforming programs to recursive equations. In FPCA, 1985. Google Scholar
Digital Library
- N. D. Jones. Mix ten years later. In PEPM, 1995. Google Scholar
Digital Library
- N. D. Jones and A. J. Glenstrup. Program generation, termination, and bindingtime analysis. In GPCE, 2002. Google Scholar
Digital Library
- N. D. Jones, P. Sestoft, and H. Søndergaard. Mix: A self-applicable partial evaluator for experiments in compiler generation (extended abstract). In MFPS, 1987. Google Scholar
Digital Library
- N. D. Jones, C. K. Gomard, and P. Sestoft. Partial Evaluation and Automatic Program Generation. Prentice-Hall, Inc., 1993. Google Scholar
Digital Library
- J. Jørgensen. Similix: a self-applicable partial evaluator for Scheme. In Partial Evaluation, 1998.Google Scholar
- U. Jørring and W. L. Scherlis. Compilers and staging transformations. In POPL, 1986. Google Scholar
Digital Library
- V. Jovanovi´c, A. Shaikhha, S. Stucki, V. Nikolaev, C. Koch, and M. Odersky. Yin-Yang: Concealing the deep embedding of DSLs. In GPCE, 2014. Google Scholar
Digital Library
- R. Karrenberg and S. Hack. Whole-function vectorization. In CGO, 2011. Google Scholar
Digital Library
- M. Katz and D. Weise. Towards a new perspective on partial evaluation. In PEPM, 1992.Google Scholar
- SYCL TM Specification. Khronos, 2015. Version 1.2.Google Scholar
- Y. Klonatos, C. Koch, T. Rompf, and H. Chafi. Building e fficient query engines in a high-level language. PVLDB, 7(10):853–864, 2014. Google Scholar
Digital Library
- R. Leißa, M. Köster, and S. Hack. A graph-based higher-order intermediate representation. In CGO, 2015.Google Scholar
Cross Ref
- M. McCool. A retargetable, dynamic compiler and embedded language. In CGO, 2011.Google Scholar
- R. Membarth, O. Reiche, C. Schmitt, F. Hannig, J. Teich, M. Stürmer, and H. Köstler. Towards a performance-portable description of geometric multigrid algorithms using a domain-specific language. JPDC, 74(12):3191–3201, 2014. Google Scholar
Digital Library
- R. Membarth, O. Reiche, F. Hannig, J. Teich, M. Körner, and W. Eckert. HIPA cc : A domain-specific language and compiler for image processing. TPDS, 2015.Google Scholar
- G. Ofenbeck, T. Rompf, A. Stojanov, M. Odersky, and M. Püschel. Spiral in Scala: towards the systematic construction of generators for performance libraries. In GPCE, 2013. Google Scholar
Digital Library
- J. Palsberg and M. I. Schwartzbach. Binding-time analysis: Abstract interpretation versus type inference. In ICCL, 1994.Google Scholar
Cross Ref
- G. D. Plotkin. LCF considered as a programming language. Theoretical Computer Science, 1977.Google Scholar
- J. Ragan-Kelley, C. Barnes, A. Adams, S. Paris, F. Durand, and S. Amarasinghe. Halide: A language and compiler for optimizing parallelism, locality, and recomputation in image processing pipelines. In PLDI, 2013. Google Scholar
Digital Library
- G. Ramalingam. On loops, dominators, and dominance frontiers. ACM Trans. Program. Lang. Syst., 2002. Google Scholar
Digital Library
- T. Rompf and M. Odersky. Lightweight modular staging: a pragmatic approach to runtime code generation and compiled DSLs. In GPCE, 2010. Google Scholar
Digital Library
- T. Rompf, A. K. Sujeeth, K. J. Brown, H. Lee, H. Chafi, and K. Olukotun. Surgical precision JIT compilers. In PLDI, 2014. Google Scholar
Digital Library
- E. Ruf. Topics in Online Partial Evaluation. PhD thesis, Stanford University, 1993. Google Scholar
Digital Library
- A. Shali and W. R. Cook. Hybrid partial evaluation. In OOPSLA, 2011. Google Scholar
Digital Library
- O. Shivers. Control-Flow Analysis of Higher-Order Languages. PhD thesis, Carnegie Mellon University, 1991. Google Scholar
Digital Library
- A. K. Sujeeth, H. Lee, K. J. Brown, H. Chafi, M. Wu, A. R. Atreya, K. Olukotun, T. Rompf, and M. Odersky. OptiML: an implicitly parallel domain-specific language for machine learning. In ICML, 2011.Google Scholar
- W. Taha and T. Sheard. MetaML and multi-stage programming with explicit annotations. In Theoretical Computer Science, 1999.Google Scholar
- W. Tait. Intensional interpretations of functionals of finite type i. J. Symb. Log., 1967.Google Scholar
Cross Ref
- S. Tobin-Hochstadt, V. St-Amour, R. Culpepper, M. Flatt, and M. Felleisen. Languages as libraries. In PLDI, 2011. Google Scholar
Digital Library
- U. Trottenberg, C. W. Oosterlee, and A. Schüller. Multigrid. Academic Press, Dec. 2000. Google Scholar
Digital Library
- T. Würthinger, C. Wimmer, A. Wöß, L. Stadler, G. Duboscq, C. Humer, G. Richards, D. Simon, and M. Wolczko. One VM to rule them all. In SPLASH, 2013. Google Scholar
Digital Library
Index Terms
Shallow embedding of DSLs via online partial evaluation
Recommendations
Shallow embedding of DSLs via online partial evaluation
GPCE 2015: Proceedings of the 2015 ACM SIGPLAN International Conference on Generative Programming: Concepts and ExperiencesThis paper investigates shallow embedding of DSLs by means of online partial evaluation. To this end, we present a novel online partial evaluator for continuation-passing style languages. We argue that it has, in contrast to prior work, a predictable ...
AnyDSL: a partial evaluation framework for programming high-performance libraries
This paper advocates programming high-performance code using partial evaluation. We present a clean-slate programming system with a simple, annotation-based, online partial evaluator that operates on a CPS-style intermediate representation. Our system ...
Building Code Generators for DSLs Using a Partial Evaluator for the Xtend Language
Part I of the Proceedings of the 6th International Symposium on Leveraging Applications of Formal Methods, Verification and Validation. Technologies for Mastering Change - Volume 8802For several years now, domain-specific languages DSLs are a mainstream tool for establishing model-based development environments in real-world projects. Typical back-end tools for external DSLs are interpreters and code generators.
Partial evaluation ...






Comments