From Generic Invocations to Generic Implementations
Konferensbidrag (offentliggjort, men ej förlagsutgivet), 2006

Software performance benefits from executing computations on constant data statically, at compile time. Unlike most languages, C++ allows expressing static computations by language means (template meta-programming), without relying on separate preprocessing tools. However, static code differs from dynamic code by syntax and even by programming style, as the former is functional, the latter imperative. A library designer who wants to support both a static and a dynamic version of an algorithm is therefore forced to design and maintain two implementations. A common formulation is presented that allows one to implement an algorithm generically by a single definition, while encoding static parameter properties within the argument types. By the choice of argument representation, the user determines how the algorithm is evaluated. This decoupling preserves all information necessary to have the compiler create appropriate code for each case. The realization by an ANSI C++ library of static constructs guarantees portability and allows an optimizing compiler to eliminate run-time overhead.

library-based software

C++

meta programming

code optimization

staging

generic programming

Författare

Andreas Priesnitz

Chalmers, Data- och informationsteknik, Datavetenskap

Sibylle Schupp

Chalmers, Data- och informationsteknik, Datavetenskap

5th Workshop on Parallel/High-Performance Object-Oriented Scientific Computing at the 20th European Conference on Object Oriented Programming - POOSC'06 Workshop Notes

Ämneskategorier

Programvaruteknik

Datavetenskap (datalogi)

Mer information

Skapat

2017-10-06