| Project title : |
ConceptC++/Rascal (working title) |
| Start date : |
January 2010 |
| Project description : |
ConceptC++[1] is a state-of-the-art extension of the C++ programming language, which brings the power of concepts to C++, improves generic programming in C++ and promotes concepts as a general main-stream extension for traditional programming languages. Specifically, ConceptC++ enables: modular type-checking of C++ templates, better compiler error diagnostics, library composition and adaptation. Furthermore, it syntactically supports concept(axiom)-based analyses and transformations.
Defined as a set of requirements on types, the notion of a concept provides a formal specification mechanism for types and expresses constraints on template type parameters. Building concept taxonomies is enabled by a concept refinement, some form of inheritance.
However, in practice, complex semantic relationships between concepts in a hierarchy may considerably complicate understanding of a concept, suggesting both a rigorous semantics of concepts and appropriate tooling support for correct use and extension of a concept definition. In addition, available concept libraries call for evaluation and comparison of concept hierarchies to identify and communicate best practices in concept design.
|
| Project contributions : |
The ConceptC++/Rascal project addresses the outlined issues, both theoretically and practically.
The theoretical contributions include:
- the notion of a comprehensive concept viewing and its definition according to the specified concept semantics[2]
- a metrics-based evaluation and comparison of concept hierarchies based on the identification of relevant concept attributes and the definition of concept metrics
- the introduction of concept querying and concept hierarchy chart notions and their definition in terms of concept attributes
The practical contributions comprises:
- the extensive empirical studies of the existing open-source concept libraries, including the ConceptC++ Standard Library[2] (the conceptualized version of the well known STL[3])
- Rascal[4]-based prototypical implementation that supports the outlined concept analyses and queries and the visualizations such as concept metric distributions, concept relational charts and concept polymetric views (the latter two refer to correlation of the concept metrics)
|
| C++ concepts : |
The illustrative example of C++ concepts given below is taken from the ConceptC++ Standard Library[2].
The concept HasAssign located at top of the hierarchy requires one associated type and one associated function, in this case, associated operator.
The concept CopyConstructible adds one axiom definition to the scope defined by the requirements refined from HasAssign and MoveConstructible.
In other words, a concept describes an abstract interface and uses the refinement mechanism to specify inheritance relationship between concepts[2]. In addition, associated requirements (not presented in the examples) can be used to place additional requirements on concept's parameters or associated types enabling another concept composition mechanism.
The example of a complex concept taxonomy from the ConceptC++<>/cpp Standard Library shown below is a good illustration of possible practical reality when dealing with concepts and constrained generics, the visualization is supported by the ConceptC++/Rascal prototype.
|
| Concept design : |
An evaluation of a concept design suggests:
- formulation of certain design concepts
- specification of concept design principles and relevant refactorings
- definition of an appropriate metrics suite that would capture the indicated design concepts
- definition of design flaws and corresponding detection mechanism
|
| Concept metrics : |
The definition of a concept metrics suite and the definition of a concept query and filtering and composition mechanisms promote a metrics-based evaluation of concept designs and their evolution.
The example given below illustrates a metric distribution depicted by concepts of the ConceptC++ Standard Library, the visualization is enabled by the ConceptC++/Rascal prototype.
The correlation of concept metrics is discussed in terms of a concept relational chart and concept polymeric view, the corresponding examples can be found below.
|
| Prototype : |
The ConceptC++/Rascal prototype is built on top of the Rascal[4] meta-programming language employed for implementing the required program analyses and transformations. The source code is structured in seven Rascal modules and one SDF module, totally, of more than 5000 code lines. All the functionality required to support various concept views and
queries and to provide the visualizations is prototypically implemented.
|
| Source code : |
The first source code release of the prototype is currently under preparation.
|
| Project members : |
Coordinator: Prof. Dr. Sibylle Schupp
Research assistants: Anastasia Izmaylova
|
| Related links : |
[1] ConceptC++: http://www.generic-programming.org/languages/conceptcpp/
[2] ConceptC++ specification: http://www.generic-programming.org/languages/conceptcpp/specification/
[3] The concepts of the C++ Standard Template Library: http://www.sgi.com/tech/stl/table_of_contents.html
[4] The Rascal meta-programming language: http://www.rascal-mpl.org/
|