A limited form of language
suitable for a speciﬁc class of
Domain Speciﬁc Language?
Venti half-caf, extra hot, no whip
Route 66, swinging, easy on
the chorus, extra solo at the
coda, and a bump at the end.
... languages are not so much a
means of expressing truth that has
already been established, but are a
means of discovering truth that
was previously unknown.
Their diversity is a diversity not of
sounds and signs but of ways of
looking at the world.
The fascinating thing is that, in my experience,
most well-written Ruby programs are already
a DSL, just by nature of Ruby’s syntax.
Symbols, blocks, optional parentheses around
parameters—these all go a long way toward
making Ruby programs read naturally.
Additionally, a well-designed application
encapsulates its problem domain, which also
just happens to be a good metric for
determining the effectiveness of a DSL. A DSL
can be thought of as (and many cases, really is)
an API for your application.
• Begin with the End in Mind
• Don’t repeat your context
• Take advantage of run-time context
• Evolve your implementation into DSL
• Martin Fowler on:
• Language Workbenches
• Internal DSL Style
• Fluent Interfaces
• Writing Domain Speciﬁc Languages, Jamis Buck
• Evolving an Embedded DSL in Java, Steve Freeman and Nat
• Language Oriented Programming: The Next programming
Paradigm, Sergey Dmitriev
• Software Factories, Microsoft
This work is licensed under the Creative Commons Attribution-Noncommercial-Share Alike 2.5