A domain-specific language (DSL) is a language that you design with a specific domain in mind.
There are two types of domain-specific languages (DSLs): external and internal.
The former implicates — in the simplest case — parsing a string into the programming language syntax. The latter, on the other hand, involves implementing a language within your own programming language.
Quoting Martin Fowler, "Internal DSLs are particular ways of using a host language to give the host language the feel of a particular language".
In this session you'll see how to implement a simple but complete internal DSL in Scala. You'll see that Scala syntax has some important features that makes it a DSL-friendly language.


Comments are closed.

It was interesting to see what Scala features that allow us to easily write DSLs...maybe the example was a bit trivial, but It's difficult to have it all.