Semantics-driven genericity: A sequel to the static C++ object-oriented programming paradigm (SCOOP 2)
Thierry Géraud · Roland Levillain
Classical (unbounded) genericity in 03 defines the interactions between generic data types and algorithms in terms of concepts. Concepts define the requirements over a type (or a parameter) by expressing constraints on its methods and dependent types (typedefs). The upcoming 0x standard will promote concepts from abstract entities (not directly enforced by the tools) to language constructs, enabling compilers and tools to perform additional checks on generic constructs as well as enabling new features (e.g., concept-based overloading). Most modern languages support this notion of signature on generic types. However, generic types built on other types and relying on concepts to both ensure type conformance and drive code specialization, restrain the interface and the implementation of the newly created type: specific methods and associated types not mentioned in the concept will not be part of the new type. The paradigm of concept-based genericity lacks the required semantics to transform types while retaining or adapting their intrinsic capabilities. We present a new form of semantically-enriched genericity allowing static generic type transformations through a simple form of type introspection based on type metadata called properties. This approach relies on a new Static Object-Oriented Programming (SCOOP) paradigm, and is adapted to the creation of generic and efficient libraries, especially in the field of scientific computing. Our proposal uses a metaprogramming facility built into a library called Static, and doesn’t require any language extension nor additional processing (preprocessor, transformation tool).