Really Embedding Domain-Specific Languages into C++

Domain-specific languages (DSLs) are both pervasive and powerful, but remain difficult to integrate into large projects. As a result, while DSLs can bring distinct advantages in performance, reliability, and maintainability, their use often involves trading off other good software-engineering practices. In this paper, we describe an extension to the Clang C++ compiler to support syntax plugins, and we demonstrate how this mechanism allows making use of DSLs inside of a C++ code base without needing to separate the DSL source code from the surrounding C++ code.

[1]  F. Verstraete,et al.  Tree tensor networks and entanglement spectra , 2013, 1309.2255.

[2]  Garnet Kin-Lic Chan,et al.  Matrix product operators, matrix product states, and ab initio density matrix renormalization group algorithms. , 2016, The Journal of chemical physics.

[3]  Tze Meng Low,et al.  SPIRAL: Extreme Performance Portability , 2018, Proceedings of the IEEE.

[4]  Steven G. Johnson,et al.  FFTW: an adaptive software architecture for the FFT , 1998, Proceedings of the 1998 IEEE International Conference on Acoustics, Speech and Signal Processing, ICASSP '98 (Cat. No.98CH36181).

[5]  F. Verstraete,et al.  Matrix product states, projected entangled pair states, and variational renormalization group methods for quantum spin systems , 2008, 0907.2796.

[6]  M. M. G. Ricci,et al.  Méthodes de calcul différentiel absolu et leurs applications , 1900 .

[7]  E. Schmidt,et al.  Lex—a lexical analyzer generator , 1990 .

[8]  L. Erlikh,et al.  Leveraging legacy system dollars for e-business , 2000 .

[9]  Michael Lange,et al.  Devito: Towards a Generic Finite Difference DSL Using Symbolic Python , 2016, 2016 6th Workshop on Python for High-Performance and Scientific Computing (PyHPC).

[10]  Murray Hill,et al.  Yacc: Yet Another Compiler-Compiler , 1978 .

[11]  Garnet Kin-Lic Chan,et al.  Efficient tree tensor network states (TTNS) for quantum chemistry: generalizations of the density matrix renormalization group algorithm. , 2013, The Journal of chemical physics.

[12]  S. Hirata Tensor Contraction Engine: Abstraction and Automated Parallel Implementation of Configuration-Interaction, Coupled-Cluster, and Many-Body Perturbation Theories , 2003 .

[13]  Shoaib Kamil,et al.  The tensor algebra compiler , 2017, Proc. ACM Program. Lang..

[14]  Jianting Cao,et al.  Higher-dimension Tensor Completion via Low-rank Tensor Ring Decomposition , 2018, 2018 Asia-Pacific Signal and Information Processing Association Annual Summit and Conference (APSIPA ASC).

[15]  Christiane Lechner,et al.  Kranc: a Mathematica package to generate numerical codes for tensorial evolution equations , 2006, Comput. Phys. Commun..

[16]  Vikram S. Adve,et al.  LLVM: a compilation framework for lifelong program analysis & transformation , 2004, International Symposium on Code Generation and Optimization, 2004. CGO 2004..

[17]  Tao Xiang,et al.  Compressing deep neural networks by matrix product operators , 2019, Physical Review Research.

[18]  Samuel Williams,et al.  The Landscape of Parallel Computing Research: A View from Berkeley , 2006 .

[19]  Alexander McCaskey,et al.  Validating quantum-classical programming models with tensor network simulations , 2018, PloS one.

[20]  Peter Bumbulis,et al.  RE2C: a more versatile scanner generator , 1993, LOPL.

[21]  Travis S. Humble,et al.  XACC: a system-level software infrastructure for heterogeneous quantum–classical computing , 2019, Quantum Science and Technology.

[22]  Amy J. Ko,et al.  Eliciting design requirements for maintenance-oriented IDEs: a detailed study of corrective and perfective maintenance tasks , 2005, Proceedings. 27th International Conference on Software Engineering, 2005. ICSE 2005..

[23]  G. Vidal Entanglement renormalization. , 2005, Physical review letters.

[24]  Saman P. Amarasinghe,et al.  Unified Sparse Formats for Tensor Algebra Compilers , 2018, ArXiv.

[25]  Markus Püschel,et al.  A Basic Linear Algebra Compiler , 2014, CGO '14.

[26]  Paolo Bientinesi,et al.  Automatic Generation of Efficient Linear Algebra Programs , 2019, PASC.

[27]  Russell W. Quong,et al.  ANTLR: A predicated‐LL(k) parser generator , 1995, Softw. Pract. Exp..