5 research outputs found
The C++0x "Concepts" Effort
C++0x is the working title for the revision of the ISO standard of the C++
programming language that was originally planned for release in 2009 but that
was delayed to 2011. The largest language extension in C++0x was "concepts",
that is, a collection of features for constraining template parameters. In
September of 2008, the C++ standards committee voted the concepts extension
into C++0x, but then in July of 2009, the committee voted the concepts
extension back out of C++0x.
This article is my account of the technical challenges and debates within the
"concepts" effort in the years 2003 to 2009. To provide some background, the
article also describes the design space for constrained parametric
polymorphism, or what is colloquially know as constrained generics. While this
article is meant to be generally accessible, the writing is aimed toward
readers with background in functional programming and programming language
theory. This article grew out of a lecture at the Spring School on Generic and
Indexed Programming at the University of Oxford, March 2010
Software Extension and Integration with Type Classes
The abilities to extend a software module and to integrate a software module into an existing software system without changing existing source code are fundamental challenges in software engineering and programming-language design. We reconsider these challenges at the level of language expressiveness, by using the language concept of type classes, as it is available in the functional programming language Haskell. A detailed comparison with related work shows that type classes provide a powerful framework in which solutions to known software extension and integration problems can be provided. We also pinpoint several limitations of type classes in this context
Static Computation and Reflection
Thesis (PhD) - Indiana University, Computer Sciences, 2008Most programming languages do not allow programs to inspect their
static type information or perform computations on it. C++, however,
lets programmers write template metaprograms, which enable programs to
encode static information, perform compile-time computations,
and make static decisions about run-time behavior. Many C++ libraries
and applications use template metaprogramming to build specialized
abstraction mechanisms, implement domain-specific safety checks, and
improve run-time performance.
Template metaprogramming is an emergent capability of the C++ type
system, and the C++ language specification is informal and imprecise.
As a result, template metaprogramming often involves heroic
programming feats and often leads to code that is difficult to read and
maintain. Furthermore, many template-based code generation and
optimization techniques rely on particular compiler implementations,
rather than language semantics, for performance gains.
Motivated by the capabilities and techniques of C++ template
metaprogramming, this thesis documents some common programming patterns,
including static computation, type analysis, generative programming, and the
encoding of domain-specific static checks. It also documents notable
shortcomings to current practice, including limited support for reflection,
semantic ambiguity, and other issues that arise from the pioneering nature of
template metaprogramming. Finally, this thesis presents the design of a
foundational programming language, motivated by the analysis of template
metaprogramming, that allows programs to statically inspect type information,
perform computations, and generate code. The language is specified as a core
calculus and its capabilities are presented in an idealized setting
Language requirements for large-scale generic libraries
Abstract. The past decade of experience has demonstrated that the generic programming methodology is highly effective for the design, implementation, and use of large-scale software libraries. The fundamental principle of generic programming is the realization of interfaces for entire sets of components, based on their essential syntactic and semantic requirements, rather than for any particular components. Many programming languages have features for describing interfaces between software components, but none completely support the approach used in generic programming. We have recently developed G, a language designed to provide first-class language support for generic programming and large-scale libraries. In this paper, we present an overview of G and analyze the interdependence between language features and libraries design in light of a complete implementation of the Standard Template Library using G. In addition, we discuss important issues related to modularity and encapsulation in large-scale libraries and how language support for validation of components in isolation can prevent many common problems in component integration.