<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="/stylesheets/rss.css" type="text/css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Tom Moertel's Weblog: Tag dsl</title>
    <link>http://blog.moertel.com/articles/tag/dsl?tag=dsl</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Quality rants on programming theory and stuff geeks like</description>
    <item>
      <title>Seven signs YOU may have created a Gratuitous Domain Specific Language</title>
      <description>&lt;p&gt;Like &lt;a href="http://use.perl.org/~chromatic/journal/"&gt;chromatic&lt;/a&gt;, I have
watched the recent irrational exuberance for domain-specific languages
(DSLs) with bewilderment.  In certain quarters of the programming
universe, it seems that creating DSLs is nearly a rite of passage.
The problem is, more and more of these DSLs appear to have been
created mainly because, well, DSLs are cool these days, even if less
&amp;#8220;novel&amp;#8221; solutions probably would have been more sensible.&lt;/p&gt;


	&lt;p&gt;Whereas chromatic &lt;a href="http://www.oreillynet.com/onlamp/blog/2007/05/the_is_it_a_dsl_or_an_api_ten.html"&gt;unhesitatingly confronted the madness
head-on&lt;/a&gt;,
I have so far managed to avoid the fray.  Sure, I&amp;#8217;ve asked the
&lt;a href="http://www.jroller.com/obie/entry/expressing_contract_terms_in_a#comment-1147246044000"&gt;occasional probing question of the &lt;span class="caps"&gt;DSL&lt;/span&gt;
enthusiast&lt;/a&gt;,
but mostly my reaction has been limited to standing back and staring
in mute amazement at the runaway Domain-Specific Fun-Time Language
Train, screaming down the tracks, destined for its inevitable high-speed
derailment into what I can only expect will be a bridge abutment.
But I&amp;#8217;m starting to get the feeling that some of the train&amp;#8217;s passengers are
aboard because they think it&amp;#8217;s the Right Thing To Do Train,
so maybe it&amp;#8217;s time to throw in my two cents.&lt;/p&gt;


	&lt;p&gt;To set the record straight, I don&amp;#8217;t have anything against DSLs,
embedded or otherwise.  (I have created &lt;a href="http://blog.moertel.com/articles/2006/03/14/talk-embedded-domain-specific-languages-for-perl"&gt;my fair
share&lt;/a&gt;,
some of which &lt;a href="http://community.moertel.com/ss/space/PXSL"&gt;are actually
useful&lt;/a&gt;.)  No, my concern is
limited strictly to the rise of the &lt;em&gt;Gratuitous &lt;span class="caps"&gt;DSL&lt;/span&gt;&lt;/em&gt;.  So let&amp;#8217;s talk
about it.&lt;/p&gt;


	&lt;p&gt;The reason &amp;#8211; the right reason &amp;#8211; for creating a &lt;span class="caps"&gt;DSL&lt;/span&gt; is because it ultimately lowers the cost
of solving problems.  If, then, you create a &lt;span class="caps"&gt;DSL&lt;/span&gt; and the cost of
solving your problems does not go down, why did you create
it?  Think about it.  Creating a &lt;span class="caps"&gt;DSL&lt;/span&gt; is an expensive proposition.  Making
people learn your &lt;span class="caps"&gt;DSL&lt;/span&gt;&amp;#8217;s syntax,
semantics, and underlying domain is a lot to ask &amp;#8211; it&amp;#8217;s costly. If you do ask, if you do make
the imposition, you had better be sure your &lt;span class="caps"&gt;DSL&lt;/span&gt; pays its bills.&lt;/p&gt;


	&lt;p&gt;But what if your &lt;span class="caps"&gt;DSL&lt;/span&gt; turns out to be a deadbeat? What if using your &lt;span class="caps"&gt;DSL&lt;/span&gt; doesn&amp;#8217;t lower the cost of solving problems? Well, guess what?  &lt;em&gt;You&lt;/em&gt; have
created a Gratuitous Domain Specific Language.&lt;/p&gt;


	&lt;p&gt;Still unsure of whether you&amp;#8217;re on the &lt;span class="caps"&gt;DSL&lt;/span&gt; Train for the wrong reason?  No problem.  Just take
this simple, seven-step test:&lt;/p&gt;


	&lt;h3&gt;Seven signs &lt;em&gt;you&lt;/em&gt; may have created a Gratuitous Domain Specific Language (GDSL)&lt;/h3&gt;


	&lt;ol&gt;
	&lt;li&gt;You can&amp;#8217;t actually explain what a &lt;span class="caps"&gt;DSL&lt;/span&gt; is.&lt;/li&gt;
		&lt;li&gt;For your &lt;span class="caps"&gt;DSL&lt;/span&gt;, you can&amp;#8217;t explain what the domain is.&lt;/li&gt;
		&lt;li&gt;You have a hard time explaining the &lt;span class="caps"&gt;DSL&lt;/span&gt;&amp;#8217;s syntax and semantics.&lt;/li&gt;
		&lt;li&gt;You have a hard time explaining how the &lt;span class="caps"&gt;DSL&lt;/span&gt; interacts with the language it is embedded in.  (For embedded DSLs only.)&lt;/li&gt;
		&lt;li&gt;A vanilla library &lt;span class="caps"&gt;API&lt;/span&gt; would have captured the domain&amp;#8217;s semantics without awkwardness.&lt;/li&gt;
		&lt;li&gt;It&amp;#8217;s easier to express complex domain concepts in general-purpose code than in your &lt;span class="caps"&gt;DSL&lt;/span&gt;.&lt;/li&gt;
		&lt;li&gt;Your colleagues have a hard time writing things in your &lt;span class="caps"&gt;DSL&lt;/span&gt;.&lt;/li&gt;
	&lt;/ol&gt;


	&lt;p&gt;Did more than a few of the statements ring true?  If so, take a bow.
&lt;em&gt;You&lt;/em&gt; are the proud creator of a Gratuitous
&lt;span class="caps"&gt;DSL&lt;/span&gt;!&lt;sup&gt;&lt;a href="#gdsl-fn1"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;


	&lt;p&gt;Even so, it&amp;#8217;s not too late.  You can always hop off the &lt;span class="caps"&gt;DSL&lt;/span&gt; Train at the next stop.&lt;/p&gt;


	&lt;p&gt;(&lt;em&gt;Note for the humor-impaired:  This post is meant to be interpreted in
tongue-in-cheek fashion.&lt;/em&gt;)&lt;/p&gt;


&lt;hr/&gt;

&lt;div class="footnote"&gt;

	&lt;p&gt;&lt;a name="gdsl-fn1"&gt;1.&lt;/a&gt; &lt;em&gt;Rationale for the Seven Signs.&lt;/em&gt; Signs
1&amp;#8211;4 suggest that your &lt;span class="caps"&gt;DSL&lt;/span&gt; may not even &lt;em&gt;be&lt;/em&gt; a &lt;span class="caps"&gt;DSL&lt;/span&gt;, so &lt;em&gt;calling&lt;/em&gt;
it a &lt;span class="caps"&gt;DSL&lt;/span&gt; is gratuitous.  Signs 4&amp;#8211;7 suggest that, though your &lt;span class="caps"&gt;DSL&lt;/span&gt;
may be real, it may not be paying the bills; thus, creating it and
foisting it upon the world was likely gratuitous.&lt;/p&gt;


&lt;/div&gt;

&lt;div class="update"&gt;
&lt;strong&gt;Update:&lt;/strong&gt; minor edit for clarity.

	&lt;p&gt;&lt;strong&gt;Update 2008-03-22:&lt;/strong&gt; edits for clarity.&lt;/p&gt;


&lt;/div&gt;</description>
      <pubDate>Sat, 18 Aug 2007 13:01:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:a7f4ca09-3250-4e6f-ab80-385247dcc969</guid>
      <author>Tom Moertel</author>
      <link>http://blog.moertel.com/articles/2007/08/18/seven-signs-you-may-have-created-a-gratuitous-domain-specific-language</link>
      <category>programming</category>
      <category>humor</category>
      <category>culture</category>
      <category>coding</category>
      <category>humor</category>
      <category>dsl</category>
      <category>edsl</category>
      <category>cargocult</category>
      <trackback:ping>http://blog.moertel.com/articles/trackback/531</trackback:ping>
    </item>
  </channel>
</rss>
