DSL is for Domain Specific Language. But does every domain needs its own language?
Rarely. DSLs are mostly invented because people are too lazy to use available tools and/or plagued with NIH syndrome.
Their poor quality as programming languages. DSLs are mostly created in haphazard fashion. First, some moron decides that instead of using YAML, .ini or even XML (because this will bloat his program so much that his suckless friends will turn away from him), he will just throw together some kind of key-value config parser.
mycoolvalue 2 mycoolstring wtf
Nice and cuddly, as all the small things are. Then he needs value names with spaces and strings with newlines. Welcome to escaping hell! Then he thinks that he needs to reuse values in other values, so he throws together interpolation, using some silly character like ^. Seriously, who's ever going to use it in string. And if he does, we can escape it...
Then he needs cycles, then variables, then functions, and we have a crappy reimplementation of PHP. That's what called DSL.
Here's a config for FDM. I copied it over, changed some vars and not touching it anymore.
set maximum-size 127M action "inbox" mbox "%h/mail/inbox" account "pop3s" pop3s server "pop.gmail.com" port 995 user "firstname.lastname@example.org" pass "pass" match all action "inbox" match "From:.*bob@idiot\\.net" action drop
This piece of shit contains examples of most DSL failures. Bizarre interpolation, strings with custom escaping, crappy variables. Pathetic excuse of a language.
The other well-known DSL is SQL. If you think it does not suck, try inserting a binary value in a table. Then write some logic for stored procedures.
EDSLs. This is like DSL, only with real programming language. Here's an example in Ruby, that's from Merb request router:
match('/wiki/diff/:sha/:pagename', :pagename => /.*/, :sha => /[a-f0-9]+/).to(:controller => :page_diffs, :action => :showpagediff).name(:showpagediff) match('/wiki/diff/:sha', :sha => /[a-f0-9]+/).to(:controller => :page_diffs, :action => :showdiff).name(:showdiff) match('/wiki/src/:pagename', :pagename => /.*/).to(:controller => :wiki_pages, :action => :src).name('articles_src')
Clean, human-readable, absolutely standard. Other good (and more embeddable) languages exist, like Lua.
In most cases, you don't even need a full-fledged programming language. You can use a declarative one, like YAML, which even has substitution and few other useful tricks. You can use JSON, INI, or even XML, just for fuck's sake, don't write your own DSL. Please.
XMonad: it uses Haskell as its config language.
ion3), awesome use Lua for configs.