<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>One Man's Walk in work &#187; dsls</title>
	<atom:link href="http://onemanswalk.com/work/tag/dsls/feed/" rel="self" type="application/rss+xml" />
	<link>http://onemanswalk.com/work</link>
	<description>jeremy lightsmith on agile, ruby, and consulting</description>
	<lastBuildDate>Wed, 04 May 2011 04:29:54 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Eventual Consistency, or things will all work out&#8230;eventually</title>
		<link>http://onemanswalk.com/work/2008/08/05/eventual-consistency-or-things-will-all-work-out-eventually/</link>
		<comments>http://onemanswalk.com/work/2008/08/05/eventual-consistency-or-things-will-all-work-out-eventually/#comments</comments>
		<pubDate>Tue, 05 Aug 2008 00:12:00 +0000</pubDate>
		<dc:creator>jeremy</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[dsls]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[	So we&#8217;re working with Amazon&#8217;s SimpleDB.  It&#8217;s pretty sweet, though the ruby libraries for it are still a bit primitive.  One of the problems you run up against when you&#8217;re writing integration tests against it is eventual consistency.

	Take this test :

	
it &#34;should save&#34; do
  customer = Customer.create!&#40;:name =&#62; 'bob', :email =&#62; 'bob@example.com'&#41;
 [...]]]></description>
			<content:encoded><![CDATA[	<p>So we&#8217;re working with <a href="http://www.amazon.com/SimpleDB-AWS-Service-Pricing/b?ie=UTF8&#038;node=342335011" title="">Amazon&#8217;s SimpleDB</a>.  It&#8217;s pretty sweet, though the ruby libraries for it are still a bit primitive.  One of the problems you run up against when you&#8217;re writing integration tests against it is eventual consistency.</p>

	<p>Take this test :</p>

	<p>
<div class="wp_syntax"><div class="code"><pre class="ruby">it <span style="color:#996600;">&quot;should save&quot;</span> <span style="color:#9966CC; font-weight:bold;">do</span>
  customer = Customer.<span style="color:#9900CC;">create</span>!<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:name</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'bob'</span>, <span style="color:#ff3333; font-weight:bold;">:email</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'bob@example.com'</span><span style="color:#006600; font-weight:bold;">&#41;</span>
  customer = Customer.<span style="color:#9900CC;">find</span><span style="color:#006600; font-weight:bold;">&#40;</span>customer.<span style="color:#9900CC;">key</span><span style="color:#006600; font-weight:bold;">&#41;</span>
  customer.<span style="color:#9900CC;">name</span>.<span style="color:#9900CC;">should</span> == <span style="color:#996600;">'bob'</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>
</p>



	<p>The way SimpleDB works, you&#8217;re assured that Customer.find will work&#8230;eventually, but not right away.</p>

	<p>For a couple days we contented ourselves to just run the integration tests a couple times until they didn&#8217;t error out.  But that got old.</p>

	<p>Enter &#8220;eventually&#8221; :</p>

	<p>
<div class="wp_syntax"><div class="code"><pre class="ruby">it <span style="color:#996600;">&quot;should save&quot;</span> <span style="color:#9966CC; font-weight:bold;">do</span>
  customer = Customer.<span style="color:#9900CC;">create</span>!<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:name</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'bob'</span>, <span style="color:#ff3333; font-weight:bold;">:email</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'bob@example.com'</span><span style="color:#006600; font-weight:bold;">&#41;</span>
  customer = eventually <span style="color:#006600; font-weight:bold;">&#123;</span> Customer.<span style="color:#9900CC;">find</span><span style="color:#006600; font-weight:bold;">&#40;</span>customer.<span style="color:#9900CC;">key</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#125;</span>
  customer.<span style="color:#9900CC;">name</span>.<span style="color:#9900CC;">should</span> == <span style="color:#996600;">'bob'</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>
</p>



	<p>It&#8217;s a very simple method (below) that just retries the passed in block until it succeeds, timing out after 10 tries.  Super simple, works like a charm.  Thank you ruby.</p>

	<p>Here&#8217;s the source :</p>

	<p>
<div class="wp_syntax"><div class="code"><pre class="ruby"><span style="color:#9966CC; font-weight:bold;">def</span> eventually<span style="color:#006600; font-weight:bold;">&#40;</span>tries = <span style="color:#006666;">0</span>, <span style="color:#006600; font-weight:bold;">&amp;</span>block<span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#9966CC; font-weight:bold;">yield</span>
<span style="color:#9966CC; font-weight:bold;">rescue</span>
  <span style="color:#CC0066; font-weight:bold;">raise</span> <span style="color:#9966CC; font-weight:bold;">if</span> tries <span style="color:#006600; font-weight:bold;">&gt;</span>= <span style="color:#006666;">10</span>
  <span style="color:#CC0066; font-weight:bold;">sleep</span> <span style="color:#006666;">0.5</span>
  eventually<span style="color:#006600; font-weight:bold;">&#40;</span>tries <span style="color:#006600; font-weight:bold;">+</span> <span style="color:#006666;">1</span>, <span style="color:#006600; font-weight:bold;">&amp;</span>block<span style="color:#006600; font-weight:bold;">&#41;</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>
</p>



	<p>I will say, I can&#8217;t help but smile every time I write &#8220;eventually&#8221; in a test&#8230; <img src='http://onemanswalk.com/work/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
 ]]></content:encoded>
			<wfw:commentRss>http://onemanswalk.com/work/2008/08/05/eventual-consistency-or-things-will-all-work-out-eventually/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Customizing Markaby &#8211; Language Level Refactorings</title>
		<link>http://onemanswalk.com/work/2007/09/26/customizing-markaby-language-level-refactorings/</link>
		<comments>http://onemanswalk.com/work/2007/09/26/customizing-markaby-language-level-refactorings/#comments</comments>
		<pubDate>Wed, 26 Sep 2007 23:14:00 +0000</pubDate>
		<dc:creator>jeremy</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[dsls]]></category>
		<category><![CDATA[markaby]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[	It&#8217;s very easy to call out to methods in markaby, but it&#8217;d be nice if you could actually customize the dsl as well.

	For example, on many of our pages we have a bottom row that has buttons that look a certain way.  So on every page, we have :

	
  table&#40;:width =&#62; &#34;100%&#34;&#41; do
 [...]]]></description>
			<content:encoded><![CDATA[	<p>It&#8217;s very easy to call out to methods in markaby, but it&#8217;d be nice if you could actually customize the dsl as well.</p>

	<p>For example, on many of our pages we have a bottom row that has buttons that look a certain way.  So on every page, we have :</p>

	<p>
<div class="wp_syntax"><div class="code"><pre class="ruby">  table<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:width</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;100%&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span>
    tr <span style="color:#9966CC; font-weight:bold;">do</span>
      td.<span style="color:#9900CC;">left</span> <span style="color:#9966CC; font-weight:bold;">do</span>
        previous_button
        first_button
      <span style="color:#9966CC; font-weight:bold;">end</span>
      td.<span style="color:#9900CC;">center</span> <span style="color:#9966CC; font-weight:bold;">do</span>
        <span style="color:#CC0066; font-weight:bold;">print</span>
      <span style="color:#9966CC; font-weight:bold;">end</span>
      td.<span style="color:#9900CC;">right</span> <span style="color:#9966CC; font-weight:bold;">do</span>
        next_button
        last_button
      <span style="color:#9966CC; font-weight:bold;">end</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>
</p>



	<p>The code for the actual buttons changes, and after a few tries to extract the whole thing into a single method, we gave up.  Our efforts had made it harder to read, not easier.  There was always just a little too much variance, and it didn&#8217;t feel right.</p>

	<p>What we really wanted to write was :</p>

	<p>
<div class="wp_syntax"><div class="code"><pre class="ruby">  last_row <span style="color:#9966CC; font-weight:bold;">do</span>
    column <span style="color:#9966CC; font-weight:bold;">do</span>
      previous_button
      first_button
    <span style="color:#9966CC; font-weight:bold;">end</span>
    column <span style="color:#9966CC; font-weight:bold;">do</span>
      <span style="color:#CC0066; font-weight:bold;">print</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
    column <span style="color:#9966CC; font-weight:bold;">do</span>
      next_button
      last_button
    <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>
</p>



	<p>This lets the buttons that change all stay in the view, and gets rid of the skeleton and positional stuff that doesn&#8217;t change.  Furthermore, it&#8217;s <span class="caps">DRY</span> and puts all that positional logic in one place instead of scattered across 20 views.</p>

	<p>How to do this?</p>

	<p>I wrote a test (in RSpec) that looks something like :</p>

	<p>
<div class="wp_syntax"><div class="code"><pre class="ruby">describe ApplicationHelper <span style="color:#9966CC; font-weight:bold;">do</span>
  it <span style="color:#996600;">&quot;should generate a table from a buttons method&quot;</span> <span style="color:#9966CC; font-weight:bold;">do</span>
    last_row<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:columns</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006666;">2</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span>
      column <span style="color:#9966CC; font-weight:bold;">do</span>
        <span style="color:#996600;">&quot;foo&quot;</span>
      <span style="color:#9966CC; font-weight:bold;">end</span>
      column <span style="color:#9966CC; font-weight:bold;">do</span>
        <span style="color:#996600;">&quot;bar&quot;</span>
      <span style="color:#9966CC; font-weight:bold;">end</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>.<span style="color:#9900CC;">should</span> == <span style="color:#996600;">'&lt;table width=&quot;100%&quot;&gt;&lt;tr&gt;'</span> <span style="color:#006600; font-weight:bold;">+</span>
                    <span style="color:#996600;">'&lt;td class=&quot;left&quot;&gt;foo&lt;/td&gt;'</span> <span style="color:#006600; font-weight:bold;">+</span> 
                    <span style="color:#996600;">'&lt;td class=&quot;right&quot;&gt;bar&lt;/td&gt;'</span> <span style="color:#006600; font-weight:bold;">+</span>
                  <span style="color:#996600;">'&lt;/tr&gt;&lt;/table&gt;'</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>
</p>



	<p>After a bunch of fiddling and poking around, I finally made the test (and a couple others) pass with this code in my ApplicationHelper :</p>

	<p>
<div class="wp_syntax"><div class="code"><pre class="ruby"><span style="color:#9966CC; font-weight:bold;">def</span> last_row<span style="color:#006600; font-weight:bold;">&#40;</span>options, <span style="color:#006600; font-weight:bold;">&amp;</span>block<span style="color:#006600; font-weight:bold;">&#41;</span>
  markaby <span style="color:#9966CC; font-weight:bold;">do</span>
    table<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:width</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;100%&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span>
      tr <span style="color:#9966CC; font-weight:bold;">do</span>
        LastRowContext.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF; font-weight:bold;">self</span>, options<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:columns</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.
                                  <span style="color:#9900CC;">instance_eval</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&amp;</span>block<span style="color:#006600; font-weight:bold;">&#41;</span>
      <span style="color:#9966CC; font-weight:bold;">end</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">class</span> LastRowContext
  <span style="color:#9966CC; font-weight:bold;">def</span> initialize<span style="color:#006600; font-weight:bold;">&#40;</span>markaby, columns<span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#0066ff; font-weight:bold;">@markaby</span>, <span style="color:#0066ff; font-weight:bold;">@column_count</span>, <span style="color:#0066ff; font-weight:bold;">@column_index</span> = 
                            markaby, columns, <span style="color:#006666;">0</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> column<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&amp;</span>block<span style="color:#006600; font-weight:bold;">&#41;</span>
    alignment = <span style="color:#9966CC; font-weight:bold;">case</span> <span style="color:#0066ff; font-weight:bold;">@column_index</span> <span style="color:#006600; font-weight:bold;">+</span>= <span style="color:#006666;">1</span>
    <span style="color:#9966CC; font-weight:bold;">when</span> <span style="color:#006666;">1</span> : <span style="color:#ff3333; font-weight:bold;">:left</span>
    <span style="color:#9966CC; font-weight:bold;">when</span> <span style="color:#0066ff; font-weight:bold;">@column_count</span> : <span style="color:#ff3333; font-weight:bold;">:right</span>
    <span style="color:#9966CC; font-weight:bold;">else</span> <span style="color:#ff3333; font-weight:bold;">:center</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    <span style="color:#0066ff; font-weight:bold;">@markaby</span>.<span style="color:#9900CC;">instance_eval</span> <span style="color:#9966CC; font-weight:bold;">do</span>
      td<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:class</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> alignment, <span style="color:#006600; font-weight:bold;">&amp;</span>block<span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>
</p>



	<p>I&#8217;m sure this could get cleaned up more; this was the work of less than an hour.  In particular, if you did this often, you could extract a common MarkabyContext superclass that had some convenience methods.  The point is, this is really easy to do, and we shouldn&#8217;t be scared to try &#8220;Language level refactorings&#8221; like this.</p>



 ]]></content:encoded>
			<wfw:commentRss>http://onemanswalk.com/work/2007/09/26/customizing-markaby-language-level-refactorings/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>DSLs vs. APIs</title>
		<link>http://onemanswalk.com/work/2006/10/27/dsls-vs-apis/</link>
		<comments>http://onemanswalk.com/work/2006/10/27/dsls-vs-apis/#comments</comments>
		<pubDate>Fri, 27 Oct 2006 17:44:42 +0000</pubDate>
		<dc:creator>jeremy</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[dsls]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[	Ever since Joe, Neal, Zak and I started working on our DSL book, we&#8217;ve had an outstanding question that we had no good concise and simple answer for.

	How is a DSL different than an API?

	We&#8217;ve spent hours talking, arguing and asking others how they would answer this question.  Still the answers we&#8217;ve had so [...]]]></description>
			<content:encoded><![CDATA[	<p>Ever since Joe, Neal, Zak and I started working on our <span class="caps">DSL</span> book, we&#8217;ve had an outstanding question that we had no good concise and simple answer for.</p>

	<h3>How is a <span class="caps">DSL</span> different than an <span class="caps">API</span>?</h3>

	<p>We&#8217;ve spent hours talking, arguing and asking others how they would answer this question.  Still the answers we&#8217;ve had so far have been too complicated and didn&#8217;t feel &#8220;right&#8221;, until today.</p>

	<p>I just got back from breakfast w/ Rob Mee, and we talked about DSLs among other things.  His answer to this question is far too simple, so simple, in fact that I think we might finally have it.</p>

	<h3>Unlike an <span class="caps">API</span>, a <span class="caps">DSL</span> has it&#8217;s own grammar.</h3>

	<p>But what if it&#8217;s an internal <span class="caps">DSL</span>?  Well, it still has an implicit grammar over and above its host language grammar.<br />
&#8212;&#8212;<br />
Rob has a background in Linguistics and drew parallels between the difference between <a href="http://en.wikipedia.org/wiki/Pidgin" title="">Pidgin Languages</a> and <a href="http://en.wikipedia.org/wiki/Creole_language" title="">Creole Languages</a></p>

	<p>A Pidgin Language is one that forms when adults from 2 disparate languages come into contact and try to communicate.  It has a minimal grammar and verb forms.  It often follows <em>subject &#8211; verb &#8211; object</em> order and uses extra words for tenses.  There are no native speakers of a Pidgin Language.</p>

	<p>However, when adults that speak a Pidgin Language teach it to their children, a funny thing happens : their children add grammar to it.  They become native speakers and the language morphs into a Creole Language.</p>

	<p>Creole Languages are much richer than their Pidgin parents.  It&#8217;s possible to more easily express complex concepts in Creole than Pidgin.  They have more structure and can be more concise and exact as a result.</p>

	<p>Interesting.</p>

	<p>(if you&#8217;re interested in Pidgin &#038; Creole, Rob recommends <a href="http://www.amazon.com/gp/product/0060958332/ref=pd_cp_b_title/104-0701260-8343952" title="">The Language Instinct</a>)</p>
 ]]></content:encoded>
			<wfw:commentRss>http://onemanswalk.com/work/2006/10/27/dsls-vs-apis/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google&#8217;s Tiny Languages</title>
		<link>http://onemanswalk.com/work/2006/06/21/google-s-tiny-languages/</link>
		<comments>http://onemanswalk.com/work/2006/06/21/google-s-tiny-languages/#comments</comments>
		<pubDate>Wed, 21 Jun 2006 21:04:00 +0000</pubDate>
		<dc:creator>jeremy</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[dsls]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[	I am struck by how my friends, my english major, only use a computer for e-mail and myspace friends are unwittingly becoming programmers.

	It&#8217;s all google&#8217;s fault.

	They&#8217;ve gone and taught my friends some domain specific languages.  Any of this look familiar?


chinese near 5503 roosevelt way, seattle


	on google maps.  Or


dentist appointment in seattle from 4pm [...]]]></description>
			<content:encoded><![CDATA[	<p>I am struck by how my friends, my english major, only use a computer for e-mail and myspace friends are unwittingly becoming programmers.</p>

	<p>It&#8217;s all google&#8217;s fault.</p>

	<p>They&#8217;ve gone and taught my friends some domain specific languages.  Any of this look familiar?</p>

<pre>
chinese near 5503 roosevelt way, seattle
</pre>

	<p>on <a href="http://maps.google.com/" title="">google maps</a>.  Or</p>

<pre>
dentist appointment in seattle from 4pm to 5pm
</pre>

	<p>on <a href="http://calendar.google.com/" title="">google calendar</a>.</p>

	<p>What is this world coming to?  And more importantly, if &#8220;dentist appointment from 4pm to 5pm&#8221; is a <span class="caps">DSL</span>, what about the interface that lets you select an appointment over that same time period by dragging and dropping?  Where is the line between <span class="caps">DSL</span> and UI?  Or is it starting to blur a little?</p>
 ]]></content:encoded>
			<wfw:commentRss>http://onemanswalk.com/work/2006/06/21/google-s-tiny-languages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Natural Language Programming</title>
		<link>http://onemanswalk.com/work/2006/06/21/natural-language-programming/</link>
		<comments>http://onemanswalk.com/work/2006/06/21/natural-language-programming/#comments</comments>
		<pubDate>Wed, 21 Jun 2006 20:34:00 +0000</pubDate>
		<dc:creator>jeremy</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[dsls]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[	
Programming games is an activity. A programming language is a kind of thing.  Inform 7 is a kind of programming language. It is either the single-most important advance in interactive fiction in a decade, or an interesting idea doomed to fail.

 &#8211; Liza Daly, Inside Inform 7

	The above is source code.  It is [...]]]></description>
			<content:encoded><![CDATA[	<p><div class="typocode"><br />
Programming games is an activity. A programming language is a kind of thing.  Inform 7 is a kind of programming language. It is either the single-most important advance in interactive fiction in a decade, or an interesting idea doomed to fail.<br />
</div></p>
 &#8211; Liza Daly, <a href="http://www.onlamp.com/pub/a/onlamp/2006/06/08/inside-inform-7.html" title="">Inside Inform 7</a>

	<p>The above is source code.  It <em>is</em> a dsl, kind of, but it&#8217;s a particular kind of dsl that is trying to look and feel like natural language.  It is completely readable by a non-programmer, and I dare say it&#8217;s writeable by one too.  It is <a href="http://www.inform-fiction.org/I7/Inform%207.html" title="">Inform 7</a> , one of the coolest things I have seen in a while.  (see <a href="http://howardlewisship.com/blog/2006/06/beyond-domain-specific-languages.html" title="">Beyond Domain Specific Languages</a> )</p>

	<p>Put this together with the <a href="/articles/2006/06/21/googles-tiny-languages" title="">simple little DSLs</a> that google is doing or the <a href="http://jayfields.blogspot.com/2006/05/executing-internal-dsl-in-multiple.html" title="">internal natural language-ish DSLs</a> that my colleague Jay Fields has been working on in ruby, and I think we are beginning to see people approach programming in a new way.</p>

	<p>This is definitely stuff that we&#8217;ll talk about in our upcoming DSLs in Ruby book.  But more importantly, it might be stuff that I use on my next project!<br />
&#8212;&#8212;<br />
Above and beyond the language, there is also a sweet <a href="http://www.inform-fiction.org/I7/Gallery.html" title=""><span class="caps">IDE</span></a> for Inform 7.  We&#8217;ll be looking at what we can learn from it here at <a href="http://blog.intentsoft.com/" title="">Intentional</a>.  You should too.</p>

	<p>It has a simple UI, is targeted toward non programmers, and is very polished and well thought out.  Good stuff.</p>
 ]]></content:encoded>
			<wfw:commentRss>http://onemanswalk.com/work/2006/06/21/natural-language-programming/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What I&#8217;m Working On</title>
		<link>http://onemanswalk.com/work/2005/08/09/what-i-m-working-on/</link>
		<comments>http://onemanswalk.com/work/2005/08/09/what-i-m-working-on/#comments</comments>
		<pubDate>Tue, 09 Aug 2005 00:00:00 +0000</pubDate>
		<dc:creator>jeremy</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[dsls]]></category>
		<category><![CDATA[life]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[	I&#8217;ve been pretty quite lately.

	Well I&#8217;ve been busy, stuff I&#8217;ve been working on that I&#8217;ll hopefully be posting more about include :

	
		Playing with Jetbrains MPS &#8211; it&#8217;s their LanguageWorkbench, and it&#8217;s nice, very nice.  If you&#8217;re totally new to the whole space, you&#8217;ll probably find it a bit frustrating, as it&#8217;s still very early [...]]]></description>
			<content:encoded><![CDATA[	<p>I&#8217;ve been pretty quite lately.</p>

	<p>Well I&#8217;ve been busy, stuff I&#8217;ve been working on that I&#8217;ll hopefully be posting more about include :</p>

	<ul>
		<li><strong>Playing with Jetbrains <a href="http://www.jetbrains.net/confluence/display/MPS/JetBrains+MPS+Download+Page" title=""><span class="caps">MPS</span></a></strong> &#8211; it&#8217;s their LanguageWorkbench, and it&#8217;s nice, very nice.  If you&#8217;re totally new to the whole space, you&#8217;ll probably find it a bit frustrating, as it&#8217;s still very early days of the <span class="caps">EAP</span> and it&#8217;s a bit rough.  But, for me, I&#8217;m coming to it from someone who&#8217;s wrestled w/ a lot of the problems that <span class="caps">MPS</span> has already solved, and it&#8217;s refreshing to see their solutions.  More Later&#8230;</li>
		<li><strong>Playing with <a href="http://incubator.apache.org/jackrabbit/" title="">JackRabbit</a></strong> &#8211; this is a java content repository.  Something like this is the perfect foundation for a language workbench to be built on top of.  More Later&#8230;</li>
		<li><strong>Starting AddressBook</strong> &#8211; this is a .net port of <span class="caps">OSX</span>&#8217;s Address Book.  I&#8217;m pretty close to releasing version 0.1, so next couple days you should see a download available here.  I&#8217;m already using it for my addresses, and it&#8217;s <em>so</em> much better than outlook&#8230;  More Later&#8230;</li>
		<li><strong>Intentional in Budapest</strong> &#8211; I&#8217;m in Europe right now, working with the Intentional team in Budapest after taking 2 weeks vacation in Sweden.  I know, rough life.</li>
	</ul>
 ]]></content:encoded>
			<wfw:commentRss>http://onemanswalk.com/work/2005/08/09/what-i-m-working-on/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Domain Specific Lanaguage</title>
		<link>http://onemanswalk.com/work/2005/06/19/domain-specific-lanaguage/</link>
		<comments>http://onemanswalk.com/work/2005/06/19/domain-specific-lanaguage/#comments</comments>
		<pubDate>Sun, 19 Jun 2005 00:00:00 +0000</pubDate>
		<dc:creator>jeremy</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[dsls]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[	Leading a band&#8212;&#8212;
Tamar, one of my good friends and a singer was telling me a story about the first time she led a band.  She was singing Route 66, and after she got up on stage, she said:


Route 66 in E Flat
Drummer, I want a big boom after "get your kicks"
We're gonna run through [...]]]></description>
			<content:encoded><![CDATA[	<p>Leading a band&#8212;&#8212;<br />
Tamar, one of my good friends and a singer was telling me a story about the first time she led a band.  She was singing Route 66, and after she got up on stage, she said:</p>

<pre>
Route 66 in E Flat
Drummer, I want a big boom after "get your kicks"
We're gonna run through it once, mess around,
come back in on the bridge and I wanna tag it on the end.

a one, a two, a one-two-three-four...
</pre>

	<p>In 15 seconds, she was able to communicate to them (a band she&#8217;d never sang with) exactly how she wanted them to perform the song.  It would have taken her half an hour to communicate the same thing to me, but she and they spoke the same language.  It was a <strong>Domain Specific Language</strong> or <span class="caps">DSL</span>.<br />
&#8212;&#8212;<br />
Examples in Software&#8212;&#8212;<br />
In software, you might have different domain specific languages, but the concept is the same.  They are able to provide more concise, precise and quickly understandable representations within a domain.</p>

	<p>Let&#8217;s look at a couple examples:</p>

	<p><strong>NAnt</strong></p>

	<p>This is a domain specific language implemented in <span class="caps">XML</span> that many java and c# developers are familiar with.  NAnt is used to build .net projects, below you&#8217;ll see a simple build file.  Notice how all the first level constructs have to do 100% with the domain of building an application.</p>

	<p>
<div class="wp_syntax"><div class="code"><pre class="xml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;project</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;MyProject&quot;</span> <span style="color: #000066;">default</span>=<span style="color: #ff0000;">&quot;build&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
  <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;clean&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;delete</span> <span style="color: #000066;">failonerror</span>=<span style="color: #ff0000;">&quot;false&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
      <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;fileset<span style="font-weight: bold; color: black;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;include</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;build/**&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span>
        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;include</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;**/bin/**&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span>
        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;include</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;**/obj/**&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span>
      <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/fileset<span style="font-weight: bold; color: black;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/delete<span style="font-weight: bold; color: black;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/target<span style="font-weight: bold; color: black;">&gt;</span></span></span>
&nbsp;
  <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;compile&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;solution</span> <span style="color: #000066;">solutionfile</span>=<span style="color: #ff0000;">&quot;MyProject.sln&quot;</span> <span style="color: #000066;">configuration</span>=<span style="color: #ff0000;">&quot;Debug&quot;</span> <span style="color: #000066;">outputdir</span>=<span style="color: #ff0000;">&quot;build&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span>
  <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/target<span style="font-weight: bold; color: black;">&gt;</span></span></span>
&nbsp;
  <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;test&quot;</span> <span style="color: #000066;">depends</span>=<span style="color: #ff0000;">&quot;compile, refresh-books&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;exec</span> <span style="color: #000066;">program</span>=<span style="color: #ff0000;">&quot;../tools/NUnit/TestRunner.exe&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
      <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;MyProject.Tests.dll&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/exec<span style="font-weight: bold; color: black;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/target<span style="font-weight: bold; color: black;">&gt;</span></span></span>
&nbsp;
  <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;build&quot;</span> <span style="color: #000066;">depends</span>=<span style="color: #ff0000;">&quot;compile, test&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/project<span style="font-weight: bold; color: black;">&gt;</span></span></span></pre></div></div>
</p>




	<p><strong>Active Records in Ruby on Rails</strong></p>

	<p>There is a lot of buzz right now around <a href="http://rubyonrails.com/" title="">Ruby on Rails</a>.  One of the things that Rails does incredibly elegantly is it&#8217;s <span class="caps">OR </span>(object/relational) mapping.</p>

	<p>
<div class="wp_syntax"><div class="code"><pre class="ruby"> <span style="color:#9966CC; font-weight:bold;">class</span> Recipe</pre></div></div>
</p>



	<p>This code just mapped the Recipe object to the recipes table in the database and whatever fields it has.  It associates every recipe with a category, and every category with a list of recipes.</p>

	<p>Again, the common pattern is that there is not a lot of code here that is not specific to the domain.  Domain specific relationships like &#8220;belongs_to&#8221; and &#8220;has_many&#8221; are represented by top level constructs.<br />
&#8212;&#8212;<br />
Summary&#8212;&#8212;<br />
In trying to explain Language Workbenches and &#8220;intentional programming&#8221;, I often talk about the value of <span class="caps">DSL</span>&#8217;s, but it&#8217;s sometimes hard to come up with examples that someone will connect with.  Here I gave a totally non-technical example, an xml based example and a ruby based example.</p>

	<p>What examples of other types of Domain Specific Lanaguages can you think of?</p>
 ]]></content:encoded>
			<wfw:commentRss>http://onemanswalk.com/work/2005/06/19/domain-specific-lanaguage/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Simonyi and Language Workbenches</title>
		<link>http://onemanswalk.com/work/2005/05/12/simonyi-and-language-workbenches/</link>
		<comments>http://onemanswalk.com/work/2005/05/12/simonyi-and-language-workbenches/#comments</comments>
		<pubDate>Thu, 12 May 2005 00:00:00 +0000</pubDate>
		<dc:creator>jeremy</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[dsls]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[	For the last 3 months that I&#8217;ve been back at ThoughtWorks, I&#8217;ve been working with Charles Simonyi at Intentional Software on their Intentional Editor.  It is one of an emerging set of tools that Martin Fowler is about to brand &#8220;Language Workbenches&#8221;.

	It&#8217;s pretty amazing stuff.  I am somewhat limited as to what I [...]]]></description>
			<content:encoded><![CDATA[	<p>For the last 3 months that I&#8217;ve been back at ThoughtWorks, I&#8217;ve been working with Charles Simonyi at <a href="http://intentsoft.com/" title="">Intentional Software</a> on their Intentional Editor.  It is one of an emerging set of tools that Martin Fowler is about to brand &#8220;Language Workbenches&#8221;.</p>

	<p>It&#8217;s pretty amazing stuff.  I am somewhat limited as to what I can say about the specifics of their editor, but I want to start talking about the field of Language Workbenches in general.</p>

	<p>I&#8217;m still figuring out what I want to talk about, separating my blog into personal / work sections (which was long overdue) is a part of it.  I believe Language Workbenches are quite possibly the next big thing in software, and I think we have some interesting road ahead of us.</p>

	<p>In the near future expect posts on things like <span class="caps">DSL</span>&#8217;s (Domain Specific Languages), or what a next generation <span class="caps">IDE</span> might look like.</p>

	<p>And if you want to know more, definitely stay current w/ http://blog.intentsoft.com/ and http://martinfowler.com/bliki</p>
 ]]></content:encoded>
			<wfw:commentRss>http://onemanswalk.com/work/2005/05/12/simonyi-and-language-workbenches/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

