
On 25/02/2011 14:13, Thomas Heller wrote:
It would be nice to have a tool like Proto but that was extended to deal with more C++ language constructs. Even if the syntax to call them requires transforming those constructs to expressions with a DSEL of its own, at least there can be a canonic way to do so.
This already exists inside proto, there are basic language constructs and it is easily extensible (through proto transforms).
There is no proto::if_, proto::while_ etc. The way I see it, Phoenix could provide the canonical way to represent statements in Proto-based DSELs.
You can hook up your DSEL into phoenix by extending meta_grammar and default_actions. Maybe a small example in the documentation would be helpful to explain how it really works ...
Since I don't see how that is possible with the current design, I would appreciate an example indeed. default_actions can only be specialized per node tag, not per domain. And I don't want to have to duplicate all the Proto node tags for my own DSEL like Phoenix does. I also don't see why the grammar should be affected. It's purely an evaluation thing, the Phoenix language itself should not be affected.
Preprocessed phoenix still needs to resolve all the operator overloads. The other points you mentioned will be reworked.
AFAIK, overload resolution is constant-time on all compilers. The compile-time slowdown should only come from parsing a larger amount of code.