[/
 / Copyright (c) 2008 Eric Niebler
 /
 / Distributed under the Boost Software License, Version 1.0. (See accompanying
 / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 /]

[section Preface]

[:["There are more things in heaven and earth, Horatio, than are dreamt of in your philosophy.]]
[:[*['-- William Shakespeare]]]

[heading Description]

Proto is a framework for building Domain Specific Embedded Languages
in C++. It provides tools for constructing, type-checking, transforming and
executing ['expression templates][footnote See
[@http://www.osl.iu.edu/~tveldhui/papers/Expression-Templates/exprtmpl.html Expression Templates]].
More specifically, Proto provides:

* An expression tree data structure.
* Operator overloads for building the tree from an expression.
* Utilities for defining the grammar to which an expression must conform.
* An extensible mechanism for immediately executing an expression template.
* An extensible set of tree transformations to apply to expression trees.
* A mechanism for giving expressions additional behaviors and members.

[heading 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 hyper-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 (DSELs). Use Proto to define
the primitives of your mini-language and let Proto handle the operator
overloading and the construction of the expression parse tree. Immediately
evaluate the expression tree by passing it a function object. Or transform the
expression tree by defining the grammar of your mini-language, decorated
with an assortment of tree transforms provided by Proto or defined by you.
Then use the grammar to give your users short and readable syntax errors
for invalid expressions! No more mumbo-jumbo -- an expression template library
developed with Proto is declarative and readable.

In short, Proto is a DSEL for defining DSELs.

[heading Influences and Related Work]

Proto was initially developed as part of _xpressive_ to simplify the job of
transforming an expression template into an executable finite state machine
capable of matching a regular expression. Since then, Proto has found
application in the redesigned and improved Spirit-2 and the related Karma
library, currently under development. As a result of these efforts, Proto
evolved into a generic and abstract grammar and tree transformation
framework applicable in a wide variety of DSEL scenarios.

The grammar and tree transformation framework is modelled on Spirit's
grammar and semantic action framework. The expression tree data structure
is similar to Fusion data structures in many respects, and is interoperable
with Fusion's iterators and algorithms.

The syntax for the grammar-matching features of `proto::matches<>` is inspired
by MPL's lambda expressions, and by Aleksey Gurtovoy's 
[@http://lists.boost.org/Archives/boost/2002/11/39718.php "round" lambda] notation.

[heading Further Reading]

A technical paper about an earlier version of Proto was accepted into the 
[@http://lcsd.cs.tamu.edu/2007/ ACM SIGPLAN Symposium on Library-Centric Software Design LCSD'07],
and can be found at [@http://lcsd.cs.tamu.edu/2007/final/1/1_Paper.pdf]. The
tree transforms described in that paper differ from what exists today.

[endsect]
