“Domain-specific languages” allow us to capture more domain-specific problems using the features of another language, like Swift. We’ll explore just what that means, starting with a toy example to pave the way for building more real-world examples.
We explore a real-world application of domain-specific languages: HTML. We will see that HTML can be modeled in Swift using types and functions and we can leverage the entire language to improve the safety and ergonomics of writing plain ole HTML.
We compare domain-specific languages to a popular alternative: templating languages.