(DSL) is a computer language specialized to a particular application domain. • This is in contrast to a general-purpose language (GPL), which is broadly applicable across domains.
drill: it is a powerful tool with a wide variety of uses, but a specific context, namely, putting holes in things. • A GPL is a complete workbench, with a variety of tools intended for performing a variety of tasks.
It is at a higher level of abstraction. • Lesser cognitive load for domain experts to write and maintain code. • The compiler (if applicable) can provide assistance while writing code. – We will see this in the type safe builder example
details on this topic. • Interpreter design pattern – Write a program description using a restricted set of primitives – Interpret the program separately • Multiple interpretations for a single program • Example, evaluate an expression tree or print it
the host language • Programs look closer to the domain • Can use language constructs – for, if, ... • Example, Anko for android layouts – Better looking layout – Easier data binding
• Lambda with receivers – http://kotlinlang.org/docs/reference/lambdas.html • Passing a lambda to the last parameter – https://kotlinlang.org/docs/reference/lambdas.html
(Work with a subset of HTML tags) – Can have tags that depend on command line arguments • Covert the HTML document to a string • Use StringBuilder for efficiency • Lets go to code!