Results 1 - 10
of
21
Library composition and adaptation using C++ concepts
- In Generative Programming and Component Engineering (GPCE
, 2007
"... Large scale software is composed of libraries produced by different entities. Non-intrusive and efficient mechanisms for adapting data structures from one library to conform to APIs of another are essential for the success of large software projects. Concepts and concept maps, planned features for t ..."
Abstract
-
Cited by 6 (2 self)
- Add to MetaCart
Large scale software is composed of libraries produced by different entities. Non-intrusive and efficient mechanisms for adapting data structures from one library to conform to APIs of another are essential for the success of large software projects. Concepts and concept maps, planned features for the next version of C++, have been designed to support adaptation, promising generic, non-intrusive, efficient, and identity preserving adapters. This paper analyses the use of concept maps for library composition and adaptation, comparing and contrasting concept maps to other common adaptation mechanisms. We report on two cases of data structure adaptation between different libraries, indicating best practices and idioms along the way. First, we adapt GUI controls from several frameworks for use with a generic layout engine, extending the application of concepts to run-time polymorphism. Second, we develop a transparent adaptation layer between an image processing library and a graph algorithm library, enabling the efficient application of graph algorithms to the image processing domain.
M.: Towards equal rights for higher-kinded types. Accepted for the
- 6th International Workshop on Multiparadigm Programming with Languages at the European Conference on Object-Oriented Programming (ECOOP
, 2007
"... Abstract. Generics are a very popular feature of contemporary OO languages, such as Java, C # or Scala. Their support for genericity is lacking, however. The problem is that they only support abstracting over proper types, and not over generic types. This limitation makes it impossible to, e.g., def ..."
Abstract
-
Cited by 5 (1 self)
- Add to MetaCart
Abstract. Generics are a very popular feature of contemporary OO languages, such as Java, C # or Scala. Their support for genericity is lacking, however. The problem is that they only support abstracting over proper types, and not over generic types. This limitation makes it impossible to, e.g., define a precise interface for Iterable, a core abstraction in Scala’s collection API. We implemented “type constructor polymorphism ” in Scala 2.5, which solves this problem at the root, thus greatly reducing the duplication of type signatures and code. 1
Automatically Identifying C++0x Concepts in Function Templates
"... An automated approach to the identification of C++0x concepts in function templates is described. Concepts are part of a new language feature appearing in the next standard for C++ (i.e., C++0x). Concept identification is the enumeration of constraints on the sets of types over which templates can b ..."
Abstract
-
Cited by 4 (4 self)
- Add to MetaCart
An automated approach to the identification of C++0x concepts in function templates is described. Concepts are part of a new language feature appearing in the next standard for C++ (i.e., C++0x). Concept identification is the enumeration of constraints on the sets of types over which templates can be instantiated. The approach analyzes template source code and computes a set of viable concept instances describing the implied data abstraction of the template parameters. The approach is evaluated on generic algorithms defined in the C++ Standard Template Library (STL). The evaluation demonstrates the effectiveness of the approach. The approach can be used to assist in reengineering existing generic libraries to C++0x. Additionally, it has the potential to assist in the validation of concept hierarchies and interface definition in generic libraries. 1.
Foundations of an adaptable container library
- MASTER'S THESIS
, 2009
"... The STL is a collection of generic containers and algorithms; the interfaces of those are specified in the C++ standard. The components in the STL are written in such a way that they can be used directly in application development. The CPH STL is an enhanced version of the STL; the significant enhan ..."
Abstract
-
Cited by 1 (1 self)
- Add to MetaCart
The STL is a collection of generic containers and algorithms; the interfaces of those are specified in the C++ standard. The components in the STL are written in such a way that they can be used directly in application development. The CPH STL is an enhanced version of the STL; the significant enhancement in the CPH STL is that it provides containers with different trade-offs with respect to performance, space efficiency, and safety.
This thesis is a complete design specification of the entire library. This design specification consists of three parts: The first part is the specification of the architecture of the library. Along with this specification, we define the different concepts for individual components, but we provide no implementation details. The second part is a complete design for the vector container. We introduce component frameworks for STL containers, which gives a high degree of code reuse and flexibility from the user's point of view. In the third (and
last) part we identify the problems related to the use of component frameworks, and provide solutions to these problems.
The key contribution of this thesis is that the architecture and the design described can be used as a starting point for designing future generic program libraries. Also, the problems related to the use of component frameworks are recurring in context of the C++ programming language. Therefore we expect that
C++ programmers will find this part interesting as well.
A Semantic Definition of Separate Type Checking in C++ with Concepts— Abstract Syntax and Complete Semantic Definition
, 2008
"... idτ type identifier........................................ 7 ..."
Abstract
-
Cited by 1 (1 self)
- Add to MetaCart
idτ type identifier........................................ 7
Identification of Idiom Usage in C++ Generic Libraries
"... Abstract—A tool supporting the automatic identification of programming idioms specific to the construction of C++ generic libraries is presented. The goal is to assist developers in understanding the complex syntactic elements of these libraries. Large C++ generic libraries are notorious for being e ..."
Abstract
-
Cited by 1 (1 self)
- Add to MetaCart
Abstract—A tool supporting the automatic identification of programming idioms specific to the construction of C++ generic libraries is presented. The goal is to assist developers in understanding the complex syntactic elements of these libraries. Large C++ generic libraries are notorious for being extremely difficult to comprehend due to their use of advanced language features and idiomatic nature. To facilitate automated identification, the idioms are equated to micropatterns, which can be evaluated by a fact extractor. These micropattern instances act as beacons for the idioms being identified. The method is applied to study a number of widely used open source C++ generic libraries.
A SEMANTICS-BASED APPROACH TO OPTIMIZING UNSTRUCTURED MESH ABSTRACTIONS
, 2008
"... Computational scientists are frequently confronted with a choice: implement algorithms using high-level abstractions, such as matrices and mesh entities, for greater programming productivity or code them using low-level language con-structs for greater execution efficiency. We have observed that the ..."
Abstract
- Add to MetaCart
Computational scientists are frequently confronted with a choice: implement algorithms using high-level abstractions, such as matrices and mesh entities, for greater programming productivity or code them using low-level language con-structs for greater execution efficiency. We have observed that the cost of im-plementing a representative unstructured mesh code with high-level abstractions is poor computational intensity—the ratio of floating point operations to mem-ory accesses. Related scientific applications frequently produce little “science per cycle ” because their abstractions both introduce additional overhead and hinder compiler analysis and subsequent optimization. Our work exploits the seman-tics of abstractions, as employed in unstructured mesh codes, to overcome these limitations and to guide a series of manual, domain-specific optimizations that significantly improve computational intensity. We propose a framework for the automation of such high-level optimizations within the ROSE source-to-source compiler infrastructure. The specification of optimizations is left to domain experts and library writers who best understand
Composable Difference Operators for Coordinate Invariant Partial Differential Equations
, 2007
"... Computer simulations are a cost efficient complement to laboratory experiments. Software for the solution of partial differential equations is part of the basic infrastructure for the evolving field of Computational Science and Engineering. Numerical analysts are involved in the development of suita ..."
Abstract
- Add to MetaCart
Computer simulations are a cost efficient complement to laboratory experiments. Software for the solution of partial differential equations is part of the basic infrastructure for the evolving field of Computational Science and Engineering. Numerical analysts are involved in the development of suitable methods and algorithms for the solution of a wide range of partial differential equations. Based on the needs of a numerical analyst, we here identify requirements on software for the solution of partial differential equations. In particular, we look at support for flexible formulations of finite difference methods on curvilinear structured grids. We present FlexOp, a software solution that meets the requirements that have been identified. The semantics of the FlexOp is highly mathematical, and includes coordinate invariant operators. The discretization strategy is specified using parameterized classes, and can be chosen independently for different instances of the same operator. The use of static polymorphism allows for a flexible and efficient implementation of the application of the discretized operator. In order to assess the FlexOp, we use them to implement a compact fourth-order Numerov method, using the TENGOME infrastructure as a basis and C++ as the implementation language. We find that the FlexOp are easy to use, because of the high agreement between mathematical derivation and implementation of the method. Compared with a special purpose implementation for a particular discretization scheme, we find that FlexOp offer a significant reduction in the number of lines of code, together with an associated enhanced maintainability. The increased flexibility comes without a cost in the form of an increase of execution time, when compared with the special purpose application. 1 1
N U I V
, 2008
"... Modern development practices encourage extensive testing of code while it is still under development, using unit tests to check individual code units in isolation. Such tests are typically case-based, checking a likely error scenario or an error that has previously been identified and fixed. Coming ..."
Abstract
- Add to MetaCart
Modern development practices encourage extensive testing of code while it is still under development, using unit tests to check individual code units in isolation. Such tests are typically case-based, checking a likely error scenario or an error that has previously been identified and fixed. Coming up with good test cases is challenging, and focusing on individual tests can distract from creating tests that cover the full functionality. Axioms, known from program specification, allow for an alternative way of generating test cases, where the intended functionality is described as rules or equations that can be checked automatically. Axioms are proposed as part of the concept feature of the upcoming C++0x standard. In this paper, we describe how tests may be generated automatically from axioms in C++ concepts, and supplied with appropriate test data to form effective automated unit tests. 1
Adobe Systems, Inc.
"... A key benefit of generic programming is its support for producing modules with clean separation. In particular, generic algorithms are written to work with a wide variety of unmodified types. The Runtime concept idiom extends this support by allowing unmodified concrete types to behave in a runtime ..."
Abstract
- Add to MetaCart
A key benefit of generic programming is its support for producing modules with clean separation. In particular, generic algorithms are written to work with a wide variety of unmodified types. The Runtime concept idiom extends this support by allowing unmodified concrete types to behave in a runtime polymorphic manner. In this paper, we describe one implementation of the runtime concept idiom, in the domain of the C++ standard template library (STL). We describe and measure the performance of runtime-polymorphic analogs of several STL algorithms. We augment the runtime concept idiom by employing a dispatch mechanism that considers both type and concept information to maximize performance when selecting algorithm implementations. We use our implementation to demonstrate the effects of different compile-time vs. run-time algorithm selection choices, and we indicate where improved language and compiler support would be useful.

