
Joel de Guzman wrote:
Andreas Pokorny wrote:
For my thesis work I wrote a DSL framework based on fusion-2. It fulfills a similar purpose like boost::xpressive's proto. Compared to proto, the framework has a rule system, allowing the user define the language rules of a domain.
Sounds interesting. Proto would be better with some way of constraining the legal expressions within a domain.
Is there any interest in a library like that?
Yes.
Some additional information: All operators defined by the framework verify the correctness of expressions querying the domain rules the expression parameters belong to, using EnableIf.
This sounds good. I wonder what the impact is on compile time.
Foreign types can be integrated into a domain by specifing adaptation rules.
The framework separates operators (or DSL functions) from language rules. Consequently rules may introduces this layer of indirection to achieve a consistent definition of language rules.
I'd like an example.
Expressions have a varying set of attributes stored in a fusion-2 map, e.g. the expressions domain is identified by an attribute inside that map. The set of attributes is controlled by the domain rules. Apart from returning the validity of expressions, rules also have to provide a result type. Hence the rule code tends to grow complex, with an increasing amount of attributes.
More examples, please!
The library lacks a proper documentation, and requires some interface changes to simplify attribute update operations. Before working on that, I wanted to see if there is interest at all.
I used the framework to implement a matrix library with a signle frontend and multiple backends, that could be picked and combined on a by expression basis.
I'm interested. I'd like to see some examples; especially on how the "rule system" works. I am also interested to know how a domain can be adapted for use by 2 or more libraries: xpressive and spirit being main examples. IOTW, in the future, spirit and xpressive parts can be shared.
Joel, Hartmut Kaiser and I have spent a lot of time working out the details of an expression template system that would work for xpressive, Spirit-2 and Hartmut's Karma library. The discussions were public on spirit-devel. Search the archives for "Spirit-2 and Subversion", "Scanner Busines, R.I.P.", "Proto Compiler Visitors", "Fusion-ifying proto parse trees", and "segmented fusion - a-ha!" In particular, this is the message where the strategy to unify all the ET libraries really crystallized: http://permalink.gmane.org/gmane.comp.parsers.spirit.devel/2620 It would be great if you could share your thoughts on how you would approach these problems with your new ET library.
To be honest, right now, for Spirit-2, I am inclined to use Eric's proto. It's been there for quite some time now and is quite mature. But, like your library, there are no docs yet (as far as I know). I'm not sure when Eric will have the time to get it outside xpressive as a standalone ET library, for review. At any rate, it would be interesting if you can form a collaboration with him. So, instead of having 2 separate ET entries, we can just have one that has the the best of both. Is that possible at all? Or is your library too different from Proto?
I too would be interested in hearing more about your ideas and helping to build a unified ET framework for boost. -- Eric Niebler Boost Consulting www.boost-consulting.com