ACCU Home page ACCU Conference Page
Search Contact us ACCU at Flickr ACCU at GitHib ACCU at Google+ ACCU at Facebook ACCU at Linked-in ACCU at Twitter Skip Navigation

pinWhat is Boost?

Overload Journal #47 - Feb 2002 + Programming Topics + Design of applications and programs   Author: Bj√∂rn Karlsson

Welcome to an introduction to Boost, and especially the community behind the Boost libraries. Although many of the libraries are amazing, the people that are Boost are the reason for the rapidly growing interest. For those of you that aren't yet Boosters, let me give you some fast facts on Boost:

Boost is a collection of class libraries for C++. The libraries range from math to threading, built on Standard C++ and highly portable. Moreover, it is also a community of expert C++ programmers, all contributing by taking part in reviews, submitting libraries, helping users etceteras.

There are currently 35 Boost libraries, and several of them are proposed for inclusion in the next C++ Standard. Beyond being an excellent source of inspiration, top-quality libraries and interesting discussions, Boost is also a place to learn. C++ Library design, design patterns and idioms are honed to perfection in the peerreviewed Boost community.

The libraries

Although reading through a list of libraries with short descriptions may seem dull to some, I assure you that it's worth your time: You will find at least five libraries that would be very useful to you, no matter what type of application you're currently working on.

any

Safe, generic container for single values of different value types, from Kevlin Henney.

array

STL compliant container wrapper for arrays of constant size, from Nicolai Josuttis.

bind and mem_fn

Generalized binders for function/object/pointers and member functions, from Peter Dimov.

call_traits

Defines types for passing parameters, from John Maddock, Howard Hinnant, et al.

compatibility

Help for non-conforming standard libraries, from Ralf Grosse- Kunstleve and Jens Maurer.

compose

Functional composition adapters for the STL, from Nicolai Josuttis.

compressed_pair

Empty member optimization, from John Maddock, Howard Hinnant, et al.

concept check

Tools for generic programming, from Jeremy Siek.

config

Helps boost library developers adapt to compiler idiosyncrasies; not intended for library users.

conversion

Numeric, polymorphic, and lexical casts, from Dave Abrahams and Kevlin Henney.

crc

Cyclic Redundancy Code, from Daryle Walker.

function

Function object wrappers for deferred calls or callbacks, from Doug Gregor.

functional

Enhanced function object adaptors, from Mark Rodgers.

graph

Generic graph components and algorithms, from Jeremy Siek and a University of Notre Dame team.

integer

Headers to ease dealing with integral types.

iterator adaptors

Adapt a base type into a standard conforming iterator, and more, from Dave Abrahams, Jeremy Siek, and John Potter.

math

Several contributions in the domain of mathematics, from various authors.

math/common_factor

Greatest common divisor and least common multiple, from Daryle Walker.

math/octonion

Octonions, from Hubert Holin

math/quaterion

Quaterions, from Hubert Holin.

math/special_functions

Mathematical special functions such as atanh, sinc, and sinhc, from Hubert Holin.

operators

Templates ease arithmetic classes and iterators, from Dave Abrahams and Jeremy Siek.

pool

Memory pool management, from Steve Cleary.

preprocessor

Preprocessor metaprogramming tools including repetition and recursion, from Vesa Karvonen.

property map

Concepts defining interfaces which map key objects to value objects, from Jeremy Siek.

python

Reflects C++ classes and functions into Python, from Dave Abrahams.

random

A complete system for random number generation, from Jens Maurer.

rational

A rational number class, from Paul Moore.

regex

Regular expression library, from John Maddock.

smart_ptr

Four smart pointer classes, from Greg Colvin and Beman Dawes.

static_assert

Static assertions (compile time assertions), from John Maddock.

test

Support for program testing and execution, from Beman Dawes.

thread

Portable C++ multi-threading, from William Kempf.

timer

Event timer, progress timer, and progress display classes, from Beman Dawes.

tokenizer

Break of a string or other character sequence into a series of tokens, from John Bandela.

tuple

Ease definition of functions returning multiple values, and more, from Jaakko Järvi.

type_traits

Templates for fundamental properties of types, from John Maddock, Steve Cleary, et al.

utility

Class noncopyable plus checked_delete(), checked_array_delete(), next(), prior() function templates, plus base-from-member idiom, from Dave Abrahams and others.

Behind the libraries

To understand more about the mysterious powers that summons so many of the very best C++ programmers, I interviewed three of the original Boosters; Beman Dawes, David Abrahams and Jens Maurer. They are important people for the C++ community, and I want to thank them for taking the time to give us their answers.

Q: What is the essence of Boost's importance?

Beman: It has created a community of C++ library users and developers.

Dave: Boost is one of the only communities working on the process and practice of library design. In today's professional software development world, it can be hard to make the case for long-term investment in reusable components. Developers are (often rightly) expected to do the simplest thing that could possibly work, under the assumption that the generalization won't be needed. As the problems they need to solve become more complex, however, they need library components that can help them keep their solutions simple. The C++ standard library goes some distance towards filling that role, but programmers will continue to need more than it provides. What should be the design, documentation, and coding practices for the libraries that programmers need? Boost's emergent collaborative process provides one answer.

Jens: First and foremost, Boost gives examples how C++ libraries should be designed. There are lots of libraries available elsewhere whose design pre-dates the ISO C++ standard. These libraries often fail to exploit the potential of compile-time evaluation (i.e. templates) and thus miss type checking and optimization opportunities. Furthermore, these libraries are occasionally difficult to extend or poorly documented.

Second, Boost produces ready-to-use, well-documented, highquality libraries from the practice of programming. The license requirements allow the use of Boost libraries in commercial and non-commercial projects free of charge, thereby helping them to produce better programs.

Third, Boost is a test-bed for components that may end up in a future revised C++ standard. I am proud to be part of a respected effort with worldwide recognition.

Fourth, Boost attracts some of the best C++ programmers in the world. Its open discussions and peer-reviews cause every participant to learn quite a lot.

Q: Which parts of Boost do you consider most important for inclusion in the Standard?

Jens: The small things: Smart pointers, utility.hpp, "functional", probably "any" and "function"

Q: When the next C++ standard is final, what do you think will happen to Boost?

Beman: The potential for Boost libraries goes way beyond the C++ Standards effort. Standardization of some of the Boost libraries may help validate the Boost concept, but just plain user interest is really important too. As long as users ask for new libraries, and developers are willing to write them, Boost will grow and prosper.

Dave: Yes, I'm sure it will continue. Boost's value to the C++ community goes well beyond standardization.

Q: The members of Boost are some of the most talented and experienced C++ developers around. What is the reason that all this talent is present in Boost?

Dave: I think most talented programmers - in any language - love to collaborate and are dying to work with others of similar caliber. A really good programmer craves thoughtful and careful review of his code, useful feedback and ideas about design alternatives. That sort of environment can be hard to find, especially If you are at the top of your game in your daily work. The process we've established at Boost and the highly professional tone of the discussion give the best programmers what they crave, and gives others a path to reaching that level.

Jens: Boost has an open discussion policy. Its peer-review atmosphere, well established in the scientific community, fosters learning for every participant. Plus, we've had the luck to distribute very little off-topic e-mail in the mailing list so far, and we as the moderators try our best so that it will stay that way. Also, Boost library authors and maintainers are asked to acknowledge contributions, another wellestablished behaviour in the scientific and open-source communities. This gives contributors a permanent record to put pride in.

Q: Why should C++ users start using the Boost libraries?

Dave: I can think of four reasons:

0. Would you rather write it yourself? The Boost libraries are time-savers and code-savers. You'll spend less time developing your application and have less code to maintain if you can re-use the appropriate Boost library.

1. Quality. Most of the boost libraries have had a more thorough review by more talented and critical eyes than I've ever seen in a commercial environment.

2. Open Source. If you absolutely need to change the library to suit your own application, the source is all there.

3. Tests. No boost libraries are accepted without a comprehensive test suite, and all are tested against a wide variety of platforms and compilers.

Q: Do you see an upper limit to the number of libraries in Boost?

Jens: No. We may have to adjust our organization to cope, though.

Q: In what areas do you think Boost will grow in the near future?

Dave: Several interesting and ambitious libraries seem to be on the immediate horizon. There is a template metaprogramming library that brings STL-like algorithms and functional programming idioms to compile-time computation, we have an effort to develop next-generation linear algebra and matrix computation, and the developers of the Spirit parsing framework have expressed an intention to "Boostify" soon.

Q: How (and to what) do you think that Boost will develop?

Beman: More of the same; more libraries, more interesting discussions. It all depends on the C++ programmers who are members of Boost, but there is no sign of interest leveling off. Every measure we have continues to show strong growth. Quality of new libraries being submitted seems strong. The future looks bright!

Dave: One of the best things about Boost is the way that the participants generate its direction, and only when enough people are sufficiently committed to pull it off. For example, in the past week a group of dedicated Boosters who straddle the developer/user line set up a separate mailing list and a Wiki for Boost users. I am convinced that this couldn't have happened if the boost moderators had tried to spearhead the effort.

Q: As Boost grows; do you plan to organize differently?

Dave: As shown by the spontaneous creation of the users list and Wiki, when Boost begins to grow beyond its capacity, I expect it to reorganize. We have been discussing different ways to enable better collaboration as this happens: we want to have the required knowledge when the time comes, but I think we've learned not to try to plan too far in advance.

Jens: We may have separate moderators for library subcollections, e.g. for the maths and numerics libraries. We may have to split the mailing list further, though there are good arguments against doing so. Namespaces in C++ and directories in the file system are hierarchical, so we have all the tools we need to effectively sub-divide organizationally.

Q: When a library is submitted to Boost, the members decide whether it should be accepted. Will that still be possible if the number of members keep increasing?

Jens: I think so. Not all members cast a vote on every submission, and it is assumed that members casting a vote have had a look at the library before. Also, the review manager is entitled to disregard votes that are cast without observing the review guidelines.

Q: Does Boost ever organize meetings or conferences?

Jens: Boost meets every half a year on the Sunday afternoon before the ISO C++ meeting starts, at the same place than the ISO C++ meeting.

Q: Boost as an independent organization has become a "waterhole" for developers from all over the world. Is this a part of the intent for Boost, or is it just a lucky side effect?

Dave: Definitely a lucky side effect. I guess that's what happens when you provide services and code that people want.

Jens: For me, it's part of the intent.

[Author's note: Select the answer that you like!]

Q: If companies hesitate to use Boost because it is free, and therefore don't offer support agreements etc, what would be your advice to them?

Beman: If the company doesn't normally have support agreements for software libraries of about the same scope as Boost, they probably don't need a support agreement for Boost either. If the company does want a support agreement, they should ask their usual support contractors for Boost support. I know several folks at one of the support companies, and they would be perfectly capable of supporting the Boost libraries.

Dave: Re-use first; rewrite if necessary. In other words, start by using the boost libraries to achieve short time-to-market with high quality. If independence from open source is important to your longterm mission, you can always go back and replace boost components with internally developed and maintained ones.

Jens: Other open-source projects (e.g. Linux) have shown that when there's money being offered, someone shows up offering support for the project. I'm confident that some of Boost's members would take a support contract when one was offered.

Q: Boost adds value to users but also aims to impact the next C++ standard. Which one is more important?

Dave: So far, making it possible for users to cover more domains with cross-platform code has been our main focus. Although many libraries seem to fit the bill for addition to the standard, a few are less likely candidates. We have also made occasional concessions to nonconforming compilers and compilers that don't implement all of the optimizations one would like, because these things have practical importance for users. One would not expect to see such concessions to appear in the C++ standard library, however. As the C++ committee prepares to start considering what the next version of C++ will look like, standardization will likely increase in importance.

Beman: The issues really go hand-in-hand. Well-developed, widely used libraries benefit both users and the C++ Standard. Users get the use of the libraries, while the standards committee gets "existing-practice" to standardize, and that is what standards committees do best. That leads to a better standard, which in turn benefits users. The circle is closed.

Jens: I agree, there isn't a clear separation between these two aims: The next C++ standard is also aimed at providing added value to users. For me, adding value to users is the major aim of Boost; be it directly (and rather short-term) or indirectly by impacting the next C++ standard. Formal standardization has the advantage of broad recognition even in non-technical circles, but takes longer to produce results.

Becoming a Booster

There are two different mailing lists of interest for Boosters - the Boost and Boost-Users. The Boost-Users list was created only a few months ago, to accommodate the needs of the many users of the Boost libraries. The list is dedicated to questions and answers for Boost library usage. The original Boost list on the other hand deals with library design, submissions, and reviews etc. The list is rather high-volume, and very suitable for those interested in library design in general, or Boost libraries in particular. Many Boost members subscribe to both lists. There is also the new Boost Wiki web (not officially maintained by Boost developers), which is another promising venture for spreading the word and increasing the discussion about Boost.

Of course, you don't have to be a member of the mailing lists to use the Boost libraries, but it is nice to know that there is a strong commitment to helping users of the libraries. The tone is always friendly, and the level of expertise is outstanding.

I find it very rewarding to follow the discussions even on libraries that I'm yet not using, because there is always new things to learn and new ideas being tossed around.

Literature

Just recently, Jeremy Siek, Lie-Quan Lee and Andrew Lumsdaine finished "The Boost Graph Library User Guide and Reference Manual", a book about the Boost Graph Library. I highly recommend it! (ISBN 0201729148).

Although there are references to Boost in many books and articles, there are no books other than the BGL book available. I'm confident this will change in the near future, as Boost is being recognized for excellent libraries, strong standards committee presence and a rapidly growing user base.

Meanwhile, be sure to read the top computer magazines - several of the Boost libraries and the techniques used in the libraries are being featured in articles.

Overload Journal #47 - Feb 2002 + Programming Topics + Design of applications and programs