Exploring the semantic gap in compiling embedded DSLs

Optimizing compilers provide valuable contributions to the quality of processed code. The vast majority of application developers rely on those capabilities to obtain binary code efficiently utilizing processing resources. However, compiler proficiency is frequently misjudged by application developers. While for some constellations the effectiveness of those optimizations is grossly underestimated, for others, mostly involving higher-level semantic concepts of embedded DSLs, the compilers' influence on the code quality tends to disappoint. In this paper, we provide examples for the effectiveness and ineffectiveness of state-of-the-art optimizing compilers in improving application code. Based on those observations we characterize the differences between positive and negative examples and provide an in-depth explanation for the short-comings of optimizing compilers. Furthermore, we present a semantic-aware compiler architecture rectifying those deficiencies and outline several example use cases demonstrating our architecture's ability to contribute to the efficiency and the capabilities of embedded DSLs.

[1]  Manuel Fähndrich,et al.  On the Relative Completeness of Bytecode Analysis Versus Source Code Analysis , 2008, CC.

[2]  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..

[3]  Arie van Deursen,et al.  Domain-specific languages: an annotated bibliography , 2000, SIGP.

[4]  Jason Merrill Generic and gimple: A new tree represen-tation for entire functions , 2003 .

[5]  Stephen Kozacik Unified, Cross-Platform, Open-Source Library Package for High-Performance Computing , 2017 .

[6]  Ulrich Rüde,et al.  High performance smart expression template math libraries , 2012, 2012 International Conference on High Performance Computing & Simulation (HPCS).

[7]  Thomas Fahringer,et al.  A Context-Aware Primitive for Nested Recursive Parallelism , 2016, Euro-Par Workshops.

[8]  Mads Torgersen Querying in C#: how language integrated query (LINQ) works , 2007, OOPSLA '07.

[9]  Thomas Fahringer,et al.  Optimizing Task Parallelism with Library-Semantics-Aware Compilation , 2015, Euro-Par.

[10]  George C. Necula,et al.  CIL: Intermediate Language and Tools for Analysis and Transformation of C Programs , 2002, CC.

[11]  John Launchbury,et al.  Building embedded systems with embedded DSLs , 2014, ICFP 2014.

[12]  Thomas Fahringer,et al.  INSPIRE: The insieme parallel intermediate representation , 2013, Proceedings of the 22nd International Conference on Parallel Architectures and Compilation Techniques.

[13]  Troy Downing,et al.  Java Virtual Machine , 1997 .