I've been looking into designing some Domain Specific Languages which I will probably implement in Clojure, but I really don't have any idea of what's involved.
The languages I have in mind are intended to be abstract languages that are readable by domain experts with little or no programming background.
Does anyone know of any tutorials, books, or other references that would be helpful?
A DSL is a language developed to address the need of a given domain. This domain can be a problem domain (e.g. insurance, healthcare, transportation) or a system aspect (e.g. data, presentation, business logic, workflow).
A good example of a DSL is HTML. It is a language for the web application domain. It can't be used for, say, number crunching, but it is clear how widely used HTML is on the web. A GPL creator does not know where the language might be used or the problems the user intends to solve with it.
The DSL code is then transformed into programming language code by an automated code generator, or alternatively the program loads the domain-specific code and executes it. This first approach, with separated General Purpose Language (GPL) and DSL code is termed external DSLs.
DSLs can be implemented either by interpretation or code generation. Interpretation (reading in the DSL script and executing it at run time) is usually easiest, but code-generation is sometimes essential. Usually the generated code is itself a high level language, such as Java or C.
You might like Martin Fowler's nascent book Domain Specific Languages. It is a work in progress and much of it is available on line. It's intended to be language agnostic.
Below are some presentations from RubyConf that I've found useful (concepts at least should map to Clojure):
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With