Boost Proto Library

The Boost Proto Library is a framework for building Embedded Domain Specific Languages in Cee Plus Plus. It is one of the Boost Libraries.

Motivation

Expression Templates are an advanced technique that C++ library developers use to define embedded mini-languages that target specific problem domains. The technique has been used to create efficient and easy-to-use libraries for linear algebra as well as to define C++ parser generators with a readable syntax. But developing such a library involves writing an inordinate amount of unreadable and unmaintainable template mumbo-jumbo. Boost.Proto eases the development of domain-specific embedded languages (EDSLs).


It is used in other boost libraries include the Boost Phoenix Library. Some of the examples make use of Boost Xpressive to handle Regular Expressions.


This is a very powerful library with lots of interesting features. It is also fairly difficult to learn without investing quite a lot of time in the effort. After a while the relationship of the various parts of the library becomes more natural. There are examples which develop several Embedded Domain Specific Languages (EDSL), including a reimplementation of Boost Lambda Library using Boost Proto Library. One feature is the ability to combine different EDSLs either one as a subdomain of the other or else to make one a subdomain of the global domain, i.e. anything. -- John Fletcher



See original on c2.com