Composing DSLs in our tools
Susan says: 1. Composing languages: a DSL can also be categorized based on whether it an encapsulated DSL that represents an application domain (e.g. finance, medical, etc) or an aspectual DSL that represents a concern that cuts across the application (concurrency, exception management, etc). Aspectual DSL are more difficult to compose and integrate as they influence the semantics of the other DSL. What type of support is currently provided or planned for aspectual DSL with MS DSL tool?
Thanks for the question, Susan.
There are a couple of interesting ways to tackle aspects like this. One is to compile to AOP, which I don't think we'll be doing. Another is to create cascading templates, which you will be able to do in the version of DSL Tools that will be out in a few weeks. Here's the way it works:
- Template-1 reads DSL-A and -- instead of producing a finished artefact -- produces ...
- Template-2, which reads DSL-B and produces (either Template-3... or) a finished artefact (program code, configuration files, etc).
This will be easier to do in the next release due out soon. I've put a note in my diary to blog the How To details then.