[rules-dev] removing DSLs

Mario Fusco mario.fusco at gmail.com
Thu Jan 31 13:35:06 EST 2013


Hi all,

after a (quite long) discussion with Mark, Edson and Michael we realized
that, to support the guided editor roundtrip without dropping our current
DSL features, we need a new format allowing to mix plain DRL and DSL
sentences but delimiting these last ones in a clear (and easy to recognize)
way.

Our first idea has been to not have dsl blocks and mark each dsl line with
an initial single quote (') like in

rule R when
    'There is a Person older than 50
then ...

Anyway this could bring to some ambiguity like, for example, with the
following plain DRL snippet:

rule R when
    Person( name ==
        'Mario' )
then ...

For the same reason we could have similar problems with many other (not too
fancy) characters. Moreover it happens quite often to have a dsl that spans
more lines, especially considering the - notation already remembered by
Wolfgang in a former email of this thread.

Taking count of that, I suggest to adopt a (xml-like) syntax that is a bit
more verbose but also much more explicit and less error-prone, like in the
following example that mixes plain drl with dsl parts:

rule R when
    $cheese: Cheese(name == "gorgonzola")
    <dsl>
        There is a Person
    - who likes $cheese
    </dsl>
then
    <dsl>Print person name</dsl>
end

Moreover I'd prefer to have a specific file extension for this kind of rule
files instead of using the standard .drl one. This is mostly because we
will need to preprocess this files with the DSL expander that translates
them in plain DRL, before to parse and compile them. For performance
reasons, I wouldn't like to apply this preprocessing to all the DRLs
because very likely more than 90% of them won't need it. I still don't know
which extension we could use. I can't think to nothing better than .edrl
(standing for Enriched DRL) at the moment, so I am open to any suggestion.

Any other feedback is welcome,
Mario
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-dev/attachments/20130131/dc3f1ce3/attachment.html 


More information about the rules-dev mailing list