arXiv (Cornell University) · 2023 · 73 citations · 15 references
ComputingComputer EngineeringComputer ScienceCompilersProgramming LanguagesScientific ComputingCompiler ConstructionData ParallelismMonte Carlo MethodsMonte Carlo SimulationNumerical AnalysisAccuracyAccuracy AnalysisCompiler SupportFloating-point ArithmeticFloating-point Error AnalysisModernizationMonte Carlo AnalysisUse Cases
The C/C++ compilation stack (Intermediate Representations (IR), compilation passes and backends) is encumbered by a steep learning curve, which we believe can be lowered by complementing it with approaches such as source-to-source compilation. Source-to-source compilation is a technology that is widely used and quite mature in certain programming environments, such as JavaScript, but that faces a low adoption rate in others. In the particular case of C and C++ some of the identified factors include the high complexity of the languages, increased difficulty in building and maintaining C/C++ parsers, or limitations on using source code as an intermediate representation. Additionally, new technologies such as Multi-Level Intermediate Representation (MLIR) have appeared as potential competitors to source-to-source compilers at this level. In this paper, we present what we have identified as current challenges of source-to-source compilation of C and C++, as well as what we consider to be opportunities and possible directions forward. We also present several examples, implemented on top of the Clava source-to-source compiler, that use some of these ideas and techniques to raise the abstraction level of compiler research on complex compiled languages such as C or C++. The examples include automatic parallelization of for loops, high-level synthesis optimisation, hardware/software partitioning with run-time decisions, and automatic insertion of inline assembly for fast prototyping of custom instructions.
15
Makoto Matsumoto, Takuji Nishimura · ACM Transactions on Modeling and Computer Simulation · 1998 · 5.7K citations
Laurent Fousse, Guillaume Hanrot, Vincent Lefèvre et al. · ACM Transactions on Mathematical Software · 2007 · 915 citations
Cindy Rubio-González, Cuong T. Nguyen, Hong Diep Nguyen et al. · 2013 · 267 citations
W. Kahan · Canadian Mathematical Bulletin · 1966 · 198 citations · Full text