19.3 Types of DSLs
When designing a DSL, we have to decide between two types—external and internal.
An external DSL
defines a new language. We have the flexibility to choose the syntax. We then parse the commands in our
new language to take actions. When I started my first job, the company asked me to maintain a DSL that needed
extensive use of lex and yacc. (I first thought they asked me to do it because I was good. I later understood they don’t ask new employees to do stuff because they’re good, but rather because no one else wants to do it!) The parsing was a lot of “fun.” We can use languages such as C++ and Java, and the support of extensive parsing capabilities and libraries, to do the heavy lifting for us. For example, we can use ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access