<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.3.3" -->
<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/"
	>

<channel>
	<title>Josh the Outspoken</title>
	<link>http://blog.reverberate.org</link>
	<description>Wholesome, enlightened ranting about programming.</description>
	<pubDate>Sun, 29 Jun 2008 16:33:29 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.3</generator>
	<language>en</language>
			<item>
		<title>Gazelle v0.2 is here!</title>
		<link>http://blog.reverberate.org/2008/06/29/gazelle-v02-is-here/</link>
		<comments>http://blog.reverberate.org/2008/06/29/gazelle-v02-is-here/#comments</comments>
		<pubDate>Sun, 29 Jun 2008 09:56:04 +0000</pubDate>
		<dc:creator>josh</dc:creator>
		
		<category><![CDATA[Gazelle]]></category>

		<guid isPermaLink="false">http://blog.reverberate.org/2008/06/29/gazelle-v02-is-here/</guid>
		<description><![CDATA[It&#8217;s been a long time coming, but Gazelle v0.2 is finally here!

The download link is on the Gazelle webpage.
Read about what&#8217;s changed in the Release Notes.
Read the latest version of the manual online, which has a &#8220;tour&#8221; section walking you through some simple examples.
Post any questions or comments about the software to the gazelle-users Google [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a long time coming, but Gazelle v0.2 is finally here!</p>
<ul>
<li>The download link is on <a href="http://www.reverberate.org/gazelle/">the Gazelle webpage</a>.</li>
<li>Read about what&#8217;s changed in <a href="http://github.com/haberman/gazelle/tree/v0.2/ReleaseNotes">the Release Notes</a>.</li>
<li>Read <a href="http://www.reverberate.org/gazelle/docs/manual.html">the latest version of the manual</a> online, which has a &#8220;tour&#8221; section walking you through some simple examples.</li>
<li>Post any questions or comments about the software to <a href="http://groups.google.com/group/gazelle-users">the gazelle-users Google Group</a>.</li>
</ul>
<p>To me, Gazelle 0.2 represents a significant shift.  With 0.2, Gazelle is finally in a place where I think it&#8217;s ready for people to tinker with.  In 0.2 there is enough documentation to figure out what&#8217;s going on, and the command-line programs like <tt>gzlparse</tt> have reasonable &#8211;help messages and can do useful things.  Starting with Gazelle 0.2, your problems are my problems: things that don&#8217;t work right should either be fixed or be written down as TODO items.</p>
<p>Gazelle 0.1 to 0.2 was a major overhaul &#8212; implementing LL(k) lookahead took major surgery.  Half the time the code didn&#8217;t actually work, because major rewrites were only partially done.  I expect all that to change with Gazelle 0.2 &#8212; I want future releases to be far more incremental, and for every commit to leave the repository in a working state.  I want a 0.2.1 and 0.2.2 that fix a lot of the edge cases that still aren&#8217;t right in 0.2 (you can read more about these shortcomings in the <a href="http://www.reverberate.org/gazelle/docs/manual.html#_an_introductory_tour">&#8220;Tour&#8221; section of the manual</a> or in <a href="http://github.com/haberman/gazelle/tree/v0.2/TODO">the TODO</a>).</p>
<p>There are still many major features to add to Gazelle in the future &#8212; you can see a list in the TODO.  But again, I think these can be added without breaking the tree in the meantime. </p>
<p>There&#8217;s one major bummer about 0.2.  I had to completely remove the &#8220;@ignore&#8221; feature, which was Gazelle&#8217;s answer to letting you ignore whitespace/comments without having a separate lexer.  I removed it because I realized that the abstraction I had invented for expressing this concept was not quite right, and that a more general-purpose abstraction was the right answer &#8212; the abstraction I have in mind will also handle things like languages embedded in other languages (like Ruby inside HTML: RHTML).  But the bummer is that for the moment, Gazelle has no answer for how to ignore whitespace/comments.  So it&#8217;s clearly not useful for real work yet.</p>
<p>So try it out and send any feedback you have to <a href="http://groups.google.com/group/gazelle-users">gazelle-users</a>.  Thanks!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.reverberate.org/2008/06/29/gazelle-v02-is-here/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Defending RPC</title>
		<link>http://blog.reverberate.org/2008/05/23/defending-rpc/</link>
		<comments>http://blog.reverberate.org/2008/05/23/defending-rpc/#comments</comments>
		<pubDate>Sat, 24 May 2008 01:09:22 +0000</pubDate>
		<dc:creator>josh</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.reverberate.org/2008/05/23/defending-rpc/</guid>
		<description><![CDATA[Steve Vinoski has come out very vocally against RPC in the last few days: see this blog entry and this mailing list post.  The blog entry (which I read first) made him sound like someone who just hasn&#8217;t been around large systems much, but then I was surprised to see that he&#8217;s a senior [...]]]></description>
			<content:encoded><![CDATA[<p>Steve Vinoski has come out very vocally against RPC in the last few days: see <a href="http://steve.vinoski.net/blog/2008/05/22/just-what-we-need-another-rpc-package/">this blog entry</a> and <a href="http://www.erlang.org/pipermail/erlang-questions/2008-May/035207.html">this mailing list post</a>.  The blog entry (which I read first) made him sound like someone who just hasn&#8217;t been around large systems much, but then I was surprised to see that he&#8217;s a senior fellow or architect or something along those lines at a company that does distributed systems.</p>
<p>His blog entry basically makes fun of Cisco for inventing/releasing another RPC system.  It&#8217;s not clear exactly what he thinks they should have done instead.  What is strange about this criticism is that tons of technology companies have developed their own RPC system &#8212; Facebook and Cisco publicly, and other technology companies I am familiar with in a not-so-public way.  Guess what: large commercial distributed systems are built largely on RPC.  Is he arguing that all of the engineers at these companies simultaneously got the bad idea of investing in something they don&#8217;t need?  If RPC is such a bad idea, then why is everybody doing it?</p>
<p>&#8220;Everybody&#8217;s doing it&#8221; obviously isn&#8217;t a justification alone, but it definitely puts the onus on the person making the critique to show why it&#8217;s a bad idea.  I got a better idea where he was coming from when I read the mailing list post.  Here&#8217;s the heart of his argument:</p>
<blockquote><p>the fundamental problem is that RPC tries to make a distributed invocation look like a local one.This can&#8217;t work because the failure modes in distributed systems are quite different from those in local systems, so you find yourself having to introduce more and more infrastructure that tries to hide all the hard details and problems that lurk beneath. That&#8217;s how we got Apollo NCS and Sun RPC and DCE and CORBA and DSOM and DCOM and EJB and SOAP and JAX-RPC, to name a few off the top of my head, each better than what came before in some ways but worse in other ways, especially footprint and complexity. But it&#8217;s all for naught because no amount of infrastructure can ever hide those problems of distribution. Network partitions are real, timeouts are real, remote host and service crashes are real, the need for piecemeal system upgrade and handling version differences between systems is real, etc. The distributed systems programmer *must* deal with these and other issues because they affect different applications very differently; no amount of hiding or abstraction can make these problems disappear.</p></blockquote>
<p>Finally something we can agree on!  Yes, on a network shit happens, and no sane RPC system will try to hide this from you.</p>
<p>But then again, I don&#8217;t know of any RPC system that <i>tries</i> to hide this from you except possibly CORBA.  Maybe there&#8217;s a horrible history here I don&#8217;t know about, but no RPC system I have ever encountered tries to hide from you the fact that on a network, shit happens.</p>
<p>So what are his other criticisms?</p>
<blockquote><p>RPC systems in C++, Java, etc. also tend to introduce higher degrees of coupling than one would like in a distributed system. Typically you have some sort of IDL that&#8217;s used to generate stubs/proxies/skeletons &#8212; code that turns the local calls into remote ones, which nobody wants to write or maintain by hand. The IDL is often simple, but the generated code is usually not. That code is normally compiled into each app in the system. Change the IDL and you have to regenerate the code, recompile it, and then retest and redeploy your apps, and you typically have to do that atomically, either all apps or none, because versioning is not accounted for.</p></blockquote>
<p>Yay, we can agree again.  RPC systems that make you do an &#8220;all at once&#8221; upgrade are a bad idea.  But again, no RPC system I have encountered makes you do this.  Does this mean that the RPC system guarantees for you that the old and new protocols are compatible?  Of course not &#8212; you don&#8217;t want your framework to be some big &#8220;I know what&#8217;s best for you&#8221; mommy that does really expensive things to solve this problem, like loading both versions of your code at the same time.  But any RPC framework worth its salt makes it <i>possible</i> to have different interface versions interoperate.  Adding a new parameter?  No problem, old servers simply won&#8217;t see it.  Completely changing the semantics of your call?  No problem &#8212; just give the new call a new name.</p>
<p>Steve&#8217;s criticism amounts to &#8220;sucky RPC systems suck.&#8221;  Yes Steve, yes they do.  But a lot of the technology world is running on non-sucky RPC systems, and from time to time you get a glimpse of that when a company like Facebook or Cisco releases their internal RPC system to the outside world.  Did Steve check to see if Cisco&#8217;s new RPC system is subject to any of his critiques?  I haven&#8217;t, but I would suspect it isn&#8217;t.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.reverberate.org/2008/05/23/defending-rpc/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Gazelle Grammar Visualization</title>
		<link>http://blog.reverberate.org/2008/04/10/gazelle-grammar-visualization/</link>
		<comments>http://blog.reverberate.org/2008/04/10/gazelle-grammar-visualization/#comments</comments>
		<pubDate>Thu, 10 Apr 2008 16:53:38 +0000</pubDate>
		<dc:creator>josh</dc:creator>
		
		<category><![CDATA[Gazelle]]></category>

		<guid isPermaLink="false">http://blog.reverberate.org/2008/04/10/gazelle-grammar-visualization/</guid>
		<description><![CDATA[I&#8217;ve been quiet about Gazelle news lately, but since I wrote last I&#8217;ve hit 3 of my 6 goals for Gazelle 0.2, and one that I hadn&#8217;t thought to include.  To review those goals and see which ones I&#8217;ve completed:

complete Strong-LL(k) lookahead support. (it&#8217;s not 100% complete yet, but it&#8217;s definitely solid enough for [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been quiet about <a href="http://www.reverberate.org/gazelle/">Gazelle</a> news lately, but since I wrote last I&#8217;ve hit 3 of my 6 goals for Gazelle 0.2, and one that I hadn&#8217;t thought to include.  To review those goals and see which ones I&#8217;ve completed:</p>
<ul>
<li><strike>complete Strong-LL(k) lookahead support.</strike> (it&#8217;s not 100% complete yet, but it&#8217;s definitely solid enough for a 0.2 release)</li>
<li><strike>a command-line compiler program (gzlc) that takes reasonable options and is simple enough to use by reading its &#8211;help</strike></li>
<li>a “tour” section for the manual</li>
<li>a command-line program (gzlparse) that can output the parse tree in a useful format, so you can see how Gazelle parses your input text.</li>
<li><strike>a test suite, so that when people report bugs I can add the bugs to the test suite and not regress.</strike>
<li>(stretch): make Gazelle self-hosting, so that the parser is more robust and easier to understand than the hand-written recursive descent parser I’m currently using. I don’t want people to have to deal with corner-case parser bugs.</li>
<li><strike>a way to visualize grammars, to spot-check them against your expectations</strike></li>
</ul>
<p>It&#8217;s the grammar visualization that I forgot to include.  I mentioned parse tree visualization a few blog posts ago, but this is different &#8212; one is visualizing how a bunch of text got parsed, the other is visualizing the grammar itself.</p>
<p>It still has room for improvement, but <a href="http://www.reverberate.org/gazelle/json-dump/">here is what my grammar visualization currently looks like for JSON</a>.  You can see an NFA for each one of your rules, a DFA for each state of lookahead, and the DFAs that do the lexing.</p>
<p>The latest code from Git (note that I recently moved from repo.or.cz to Github) can generate these grammar dumps &#8212; just pass &#8216;-d&#8217; to gzlc.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.reverberate.org/2008/04/10/gazelle-grammar-visualization/feed/</wfw:commentRss>
		</item>
		<item>
		<title>The future of automatic memory management</title>
		<link>http://blog.reverberate.org/2008/04/09/the-future-of-automatic-memory-management/</link>
		<comments>http://blog.reverberate.org/2008/04/09/the-future-of-automatic-memory-management/#comments</comments>
		<pubDate>Thu, 10 Apr 2008 02:44:19 +0000</pubDate>
		<dc:creator>josh</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.reverberate.org/2008/04/09/the-future-of-automatic-memory-management/</guid>
		<description><![CDATA[Observation #1: stop-the-world garbage collection is a thorn in the side of latency-sensitive applications.
Observation #2: we will very soon have more cores than we know what to do with.
Prediction: fully concurrent garbage collection is the future of automatic memory management.  I&#8217;m talking garbage collectors that run in other threads and clean up after me [...]]]></description>
			<content:encoded><![CDATA[<p><b>Observation #1:</b> stop-the-world garbage collection is a thorn in the side of latency-sensitive applications.</p>
<p><b>Observation #2:</b> we will very soon have more cores than we know what to do with.</p>
<p><b>Prediction:</b> fully concurrent garbage collection is the future of automatic memory management.  I&#8217;m talking garbage collectors that run in other threads and clean up after me without ever stopping me in the middle of what I&#8217;m doing.</p>
<p>It will almost certainly be more expensive in terms of total CPU time, and probably can&#8217;t be as aggressive in terms of what it can reclaim at any point in time, but for most applications the latency guarantees will far outweigh.</p>
<p>Discuss.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.reverberate.org/2008/04/09/the-future-of-automatic-memory-management/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Python threading blues</title>
		<link>http://blog.reverberate.org/2008/03/20/python-threading-blues/</link>
		<comments>http://blog.reverberate.org/2008/03/20/python-threading-blues/#comments</comments>
		<pubDate>Thu, 20 Mar 2008 23:16:01 +0000</pubDate>
		<dc:creator>josh</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.reverberate.org/2008/03/20/python-threading-blues/</guid>
		<description><![CDATA[Some Python fan please tell me that I&#8217;m missing something.
Is this really the boilerplate necessary for creating even the simplest thread in Python?

import threading
class MyThread&#40;threading.Thread&#41;:
&#160; def __init__&#40;self, arg, **kwargs&#41;:
&#160; &#160; threading.Thread.__init__&#40;self, **kwargs&#41;
&#160; &#160; self.arg = arg
&#160; def run&#40;self&#41;:
&#160; &#160; print &#34;I&#8217;m running in a thread, with arg %d!&#34; % &#40;self.arg&#41;
thread = MyThread&#40;5&#41;
thread.start&#40;&#41;
&#160;
This is making me [...]]]></description>
			<content:encoded><![CDATA[<p>Some Python fan please tell me that I&#8217;m missing something.</p>
<p>Is this really the boilerplate necessary for creating even the simplest thread in Python?</p>
<div class="ch_code_container" style="font-family: Courier, monospace;white-space: nowrap;height:100%;">
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">threading</span></p>
<p><span style="color: #ff7700;font-weight:bold;">class</span> MyThread<span style="color: black;">&#40;</span><span style="color: #dc143c;">threading</span>.<span style="color: black;">Thread</span><span style="color: black;">&#41;</span>:<br />
&nbsp; <span style="color: #ff7700;font-weight:bold;">def</span> <span style="color: #0000cd;">__init__</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, arg, **kwargs<span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; <span style="color: #dc143c;">threading</span>.<span style="color: black;">Thread</span>.<span style="color: #0000cd;">__init__</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, **kwargs<span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">arg</span> = arg</p>
<p>&nbsp; <span style="color: #ff7700;font-weight:bold;">def</span> run<span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;I&#8217;m running in a thread, with arg %d!&quot;</span> % <span style="color: black;">&#40;</span><span style="color: #008000;">self</span>.<span style="color: black;">arg</span><span style="color: black;">&#41;</span></p>
<p><span style="color: #dc143c;">thread</span> = MyThread<span style="color: black;">&#40;</span><span style="color: #ff4500;">5</span><span style="color: black;">&#41;</span><br />
<span style="color: #dc143c;">thread</span>.<span style="color: black;">start</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><br />
&nbsp;</div>
<p>This is making me miss Ruby, for which the equivalent is:</p>
<div class="ch_code_container" style="font-family: Courier, monospace;white-space: nowrap;height:100%;">
thread = Thread.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006666;">5</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> |arg|<br />
&nbsp; <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;I&#8217;m running in a thread, with arg #{arg}!&quot;</span><br />
<span style="color:#006600; font-weight:bold;">&#125;</span><br />
&nbsp;</div>
<p>P.S.  Gazelle 0.2 is making a lot of progress, but unfortunately won&#8217;t hit the 1 month mark I hoped for.  Surprise surprise.  But when it does come, it&#8217;s going to be awesome.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.reverberate.org/2008/03/20/python-threading-blues/feed/</wfw:commentRss>
		</item>
		<item>
		<title>What&#8217;s the best way to visualize a parse tree?</title>
		<link>http://blog.reverberate.org/2008/02/26/whats-the-best-way-to-visualize-a-parse-tree/</link>
		<comments>http://blog.reverberate.org/2008/02/26/whats-the-best-way-to-visualize-a-parse-tree/#comments</comments>
		<pubDate>Wed, 27 Feb 2008 07:52:44 +0000</pubDate>
		<dc:creator>josh</dc:creator>
		
		<category><![CDATA[Gazelle]]></category>

		<guid isPermaLink="false">http://blog.reverberate.org/2008/02/26/whats-the-best-way-to-visualize-a-parse-tree/</guid>
		<description><![CDATA[I&#8217;m asking this question, not answering it!
While you&#8217;re sitting tight waiting for Gazelle 0.2, I have a challenge I&#8217;m putting to my readers.  I want my program gzlparse to parse some input text and output the parse tree in some useful format.  What is the most useful format for visualizing a parse tree?
I [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m asking this question, not answering it!</p>
<p>While you&#8217;re sitting tight waiting for Gazelle 0.2, I have a challenge I&#8217;m putting to my readers.  I want my program <code>gzlparse</code> to parse some input text and output the parse tree in some useful format.  What is the most useful format for visualizing a parse tree?</p>
<p>I want both a good text-based format and a good graphical format, if possible.  For text formats there&#8217;s:</p>
<ul>
<li>XML (ugh.  I didn&#8217;t want to say it, but I knew someone else would if I didn&#8217;t first.  I&#8217;ll probably support it, but I&#8217;ll put ambivalent emoticons in the source code).</li>
<li>S-expressions.  Maybe I&#8217;ll win over some LISPers.</li>
<li>??</li>
</ul>
<p>A good useful text format would be nice, but a good <em>graphical</em> format could be groundbreaking.  I could always draw it as a tree, but I&#8217;m wondering if there isn&#8217;t something better.  Something that keeps the text in its original format, but uses color or borders or something like that to represent the parse tree structure.</p>
<p>Here&#8217;s an example of the kind of visualization I think is really great and innovative.  It&#8217;s the way that <a href="http://lurker.sf.net">Lurker</a> displays an email thread:</p>
<p><img src='http://blog.reverberate.org/wp-content/uploads/2008/02/lurker.png' alt='lurker' /></p>
<p>What&#8217;s so brilliant about this view is that it shows you both time-order of the messages <em>and</em> complete threading information in an attractive way.  Of course, this is simpler than a parse tree, and such a nice view of a parse tree might not be possible.  But what I&#8217;d really love to see is a parse tree visualization that:</p>
<ul>
<li>kept the original text recognizable (viewing it purely as a tree throws away the original text formatting completely)</li>
<li>shows the parse tree structure somehow</li>
<li>major bonus: can be rendered in a browser using a DOM.  like, would allow me to write JavaScript to create this DOM inside the browser.</li>
</ul>
<p>If this were possible, then I could write a web-based syntax analyzing text box that parsed your text as you typed it and showed you beautiful graphical representations of the parse.  Something like <a href="http://osteele.com/tools/reanimator/">this extremely awesome interactive regex visualizer</a>, but for full context-free grammars.  Or something like what <a href="http://www.antlr.org/works/index.html">ANTLRWorks</a> provides, but on the web.</p>
<p>That would be SO HOT.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.reverberate.org/2008/02/26/whats-the-best-way-to-visualize-a-parse-tree/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Setting the sights for Gazelle 0.2</title>
		<link>http://blog.reverberate.org/2008/02/26/setting-the-sights-for-gazelle-02/</link>
		<comments>http://blog.reverberate.org/2008/02/26/setting-the-sights-for-gazelle-02/#comments</comments>
		<pubDate>Wed, 27 Feb 2008 07:31:48 +0000</pubDate>
		<dc:creator>josh</dc:creator>
		
		<category><![CDATA[Gazelle]]></category>

		<guid isPermaLink="false">http://blog.reverberate.org/2008/02/26/setting-the-sights-for-gazelle-02/</guid>
		<description><![CDATA[I&#8217;m really excited about the interest the Gazelle manual has generated!  Thanks for checking it out, and for your feedback.
I got a little scared when people said they were going to start trying Gazelle out now, because it immediately made me think of how many things I&#8217;ve been meaning to fix before I unleashed [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m really excited about the interest the Gazelle manual has generated!  Thanks for checking it out, and for your feedback.</p>
<p>I got a little scared when people said they were going to start trying Gazelle out now, because it immediately made me think of how many things I&#8217;ve been meaning to fix before I unleashed it on anybody else!  But on the other hand, it gives me all the more motivation to get it to a point where other people <em>can</em> try it out.  And I&#8217;m never more motivated or get as much done as when I know people are waiting for me!</p>
<p>So here&#8217;s my line for the moment.  <strong>Don&#8217;t try out Gazelle just yet.</strong>  There are too many things for me to fix at the moment that I <em>know</em> are broken.  But I want to fix those things ASAP and get Gazelle 0.2 out the door, so I can finally have a release that I can recommend people try out.</p>
<p>When will Gazelle 0.2 come?  I&#8217;m hoping no more than a month.  Here&#8217;s the target feature set:</p>
<ul>
<li>complete Strong-LL(k) lookahead support.  I have the code to generate Strong-LL(k) lookahead, I just need to support this at the bytecode and runtime stage.</li>
<li>a command-line compiler program (<code>gzlc</code>) that takes reasonable options and is simple enough to use by reading its <code>--help</code></li>
<li>a &#8220;tour&#8221; section for the manual</li>
<li>a command-line program (<code>gzlparse</code>) that can output the parse tree in a useful format, so you can see how Gazelle parses your input text.</li>
<li>a test suite, so that when people report bugs I can add the bugs to the test suite and not regress.  this will be important for keeping my sanity.</li>
<li>(stretch): make Gazelle self-hosting, so that the parser is more robust and easier to understand than the hand-written recursive descent parser I&#8217;m currently using.  I don&#8217;t want people to have to deal with corner-case parser bugs.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.reverberate.org/2008/02/26/setting-the-sights-for-gazelle-02/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Gazelle Manual</title>
		<link>http://blog.reverberate.org/2008/02/25/gazelle-manual/</link>
		<comments>http://blog.reverberate.org/2008/02/25/gazelle-manual/#comments</comments>
		<pubDate>Mon, 25 Feb 2008 08:35:59 +0000</pubDate>
		<dc:creator>josh</dc:creator>
		
		<category><![CDATA[Gazelle]]></category>

		<guid isPermaLink="false">http://blog.reverberate.org/2008/02/25/gazelle-manual/</guid>
		<description><![CDATA[Check out the Gazelle manual that I just put online.  I&#8217;ve put a ton of work into it, and it&#8217;s surprisingly substantial for a project at this stage.  I invested the work now because I want something I can point people to that demonstrates my plan for Gazelle, even if the implementation isn&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>Check out <a href="http://www.reverberate.org/gazelle/docs/manual.html">the Gazelle manual</a> that I just put online.  I&#8217;ve put a ton of work into it, and it&#8217;s surprisingly substantial for a project at this stage.  I invested the work now because I want something I can point people to that demonstrates my plan for Gazelle, even if the implementation isn&#8217;t there yet.  For people who are veterans in the parsing field, I want to be able to point them here when they ask the question &#8220;so what kind of algorithm are you using?&#8221;  For people who are skeptical that I can really improve on existing tools, I want to point them here to demonstrate my concrete plans for doing so.</p>
<p>Think of it as &#8220;the anti-fluff piece.&#8221;  And as a bonus, when Gazelle is actually ready for general consumption, it will have a great manual ready-to-go.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.reverberate.org/2008/02/25/gazelle-manual/feed/</wfw:commentRss>
		</item>
		<item>
		<title>(Not) Porting Gazelle from Lua to JavaScript</title>
		<link>http://blog.reverberate.org/2008/02/18/porting-gazelle-from-lua-to-javascript/</link>
		<comments>http://blog.reverberate.org/2008/02/18/porting-gazelle-from-lua-to-javascript/#comments</comments>
		<pubDate>Mon, 18 Feb 2008 08:46:42 +0000</pubDate>
		<dc:creator>josh</dc:creator>
		
		<category><![CDATA[Gazelle]]></category>

		<guid isPermaLink="false">http://blog.reverberate.org/2008/02/18/porting-gazelle-from-lua-to-javascript/</guid>
		<description><![CDATA[Update: Since writing this entry, I opted not to actually do a port, for reasons that are discussed in the comments.  However, I&#8217;m leaving the entry around to show the thought process I went through.
I&#8217;m strongly considering porting Gazelle from Lua to JavaScript.  I haven&#8217;t fully decided whether I&#8217;ll do this, and to [...]]]></description>
			<content:encoded><![CDATA[<p><b>Update:</b> Since writing this entry, I opted not to actually do a port, for reasons that are discussed in the comments.  However, I&#8217;m leaving the entry around to show the thought process I went through.</p>
<p>I&#8217;m strongly considering porting Gazelle from Lua to JavaScript.  I haven&#8217;t fully decided whether I&#8217;ll do this, and to be honest I&#8217;m not terribly thrilled about the switch.  I&#8217;m going to lay the case for switching out and leave it to you, my dear readers (all 3 of you) to weigh in about whether this is a good idea.</p>
<p>This isn&#8217;t just about Gazelle &#8212; it&#8217;s really addressing the bigger question of what language best fills the niche I&#8217;m going after.  I would describe the niche as: &#8220;small, fast, flexible language for embedding.&#8221;</p>
<p>Sounds just like what Lua was designed for, no?  Indeed, Lua has been something of a dream to use.  It&#8217;s fast, flexible, easy to learn, easy to embed, tiny, and has a tiny JIT available (disabusing me of the notion that JITs can only accompany bloated monstrosities like the JVM).  So why switch from Lua?</p>
<p>Three main reasons.  The first is that, <a href="http://steve-yegge.blogspot.com/2007/06/rhino-on-rails.html">as Steve Yegge noted when he explained why he ported Rails to JavaScript</a>, JavaScript is the most accepted language of its type inside Google, and I want to see Gazelle take on a life of its own inside Google.  I want to be able to write tools using it and have at least the slightest chance that my colleagues will take it seriously.  If the imperative language that accompanies Gazelle is JavaScript, there will be an element of familiarity, and hopefully it will be possible to find someone to hack on it with me.  Lua is unknown in comparison.</p>
<p>The second reason is much like the first: JavaScript is just more familiar to programmers in general.  People know it from web browsers (even if they still think that the language itself is to blame for their browser compatibility nightmares).  It is based in &#8220;curly brace syntax,&#8221; which gives Java, C, and C++ programmers warm fuzzies.  It&#8217;s kind of lucky that a language as totally decent as JavaScript is set to become one of the most widely used languages, at least for the next several years.</p>
<p>The third reason is that it gives me a strategy for making Gazelle work on the JVM.  There isn&#8217;t any real Lua implementation on the JVM, and Java heads HATE anything that uses JNI to talk to the outside world (because then it isn&#8217;t &#8220;100% pure Java&#8221;).  But Rhino, on the other hand, is a pretty reasonable JavaScript implementation and it <i>is</i> 100% pure Java.  So using JavaScript gives me a good JVM portability strategy.</p>
<p>So why am I less than thrilled about making the switch?  The main problem is that there aren&#8217;t any JavaScript implementations that are remotely as nice as the Lua interpreter.  Lua is idyllic.</p>
<ul>
<li>the entire Lua interpreter download is 200Kb</li>
<li>it compiles in 4 seconds on my desktop</li>
<li>it compiles to a 200Kb executable (130Kb stripped)</li>
<li>it runs &#8220;Hello, World&#8221; in 3ms (startup time is nearly 0)</li>
<li>it runs nontrivial benchmarks <a href="http://shootout.alioth.debian.org/gp4/lua.php">among the fastest of the scripting languages</a></li>
<li>it <a href="http://luajit.org/luajit.html">has a JIT available</a> that adds only 32Kb of code (compiled) to the core, and compiles most functions in microseconds (very low overhead and memory footprint)</li>
<li>it has a really good and well-documented embedding/extension API</li>
</ul>
<p>I believe there is a profound benefit to making software as lightweight as it can possibly be while still accomplishing its task.  Most software fails miserably by this criteria.  I often think of Pascal&#8217;s quote &#8220;I would have written a shorter letter, but I did not have the time&#8221; and think how much better off we would be if software developers had the same attitude.  Lua is one of those rare jewels that takes this to heart.  But let&#8217;s take a look at Tamarin, which is the favored next-gen JavaScript implementation.  This is from the documentation about <a href="http://developer.mozilla.org/en/docs/MMgc">it&#8217;s garbage collector:</a>.</p>
<blockquote><p>MMgc is not only a garbage collector, but a general-purpose memory manager. The Flash Player uses it for nearly all memory allocations.</p></blockquote>
<p>Oh fantastic!  Because definitely the one thing that my application doesn&#8217;t already have is a memory manager. I am so glad that embedding JavaScript into my program is going to drag in a 15,000 lines of code implementing heaps, spin locks, memory barriers, and complicated C++ macros.  Couldn&#8217;t you have taken the time to write a shorter letter &#8212; err, language implementation?  Does JavaScript really need that entire 15,000 line memory manager?  Let&#8217;s get some perspective on what you can do in 15,000 lines:</p>
<ul>
<li>Lua is 14,000 lines <i>total</i>.  That includes the lexer, parser, vm, compiler, byte code format, extension APIs, all of the standard libraries, <i>and</i> the garbage collector.</li>
<li>Gazelle is currently 5000 lines <i>total</i>.  That includes the parser, LL lookahead calculation, NFA construction, NFA to DFA conversion, DFA minimization, code to read and write byte code in Bitcode format, and code to do the actual parsing.</li>
</ul>
<p>If you add the code in Tamarin core, you&#8217;re now up to 70,000 lines of code.  Add in the regular expression library and you&#8217;re up to 95,000.  Sure, JavaScript as a language isn&#8217;t as minimal as Lua, but is it really 6 times more difficult to implement?</p>
<p>I know that Tamarin is a gift from Adobe, and that I shouldn&#8217;t kick a gift horse in the mouth.  Their software from which they have taken Tamarin is probably happy to use MMgc everywhere.  I just wish that our profession gave greater value to the virtue of brevity.</p>
<p>You might write me off as a sad, strange man to care so much about this, but are you so willing to write off <a href="http://steve-yegge.blogspot.com/2007/12/codes-worst-enemy.html">Steve Yegge</a>?  Code&#8217;s worst enemy is size, he says.  So there!  Proof by Steve Yegge.</p>
<p>Back to JavaScript and Lua.  I think JavaScript is a fine language for my porpoises.  I just wish there was an implementation of it that was as good as Lua.  Size, speed, flexibility, choose any three.  No?  But Lua does!</p>
<p>I&#8217;ve looked over all of the <a href="http://en.wikipedia.org/wiki/List_of_ECMAScript_engines">JavaScript implementations listed on Wikipedia</a>.  Spidermonkey is small-ish and flexible, but slow.  Of the other implementations I like <a href="http://www.njs-javascript.org/">NJS</a> the best (but it looks unmaintained), and <a href="http://www.adaptive-enterprises.com.au/~d/software/see/">SEE</a> looks ok too.  But none of these is nearly as nice and small as Lua.  It will be hard to let it go.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.reverberate.org/2008/02/18/porting-gazelle-from-lua-to-javascript/feed/</wfw:commentRss>
		</item>
		<item>
		<title>More thoughts on good programmers</title>
		<link>http://blog.reverberate.org/2008/02/12/more-thoughts-on-good-programmers/</link>
		<comments>http://blog.reverberate.org/2008/02/12/more-thoughts-on-good-programmers/#comments</comments>
		<pubDate>Tue, 12 Feb 2008 09:11:03 +0000</pubDate>
		<dc:creator>josh</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.reverberate.org/2008/02/12/more-thoughts-on-good-programmers/</guid>
		<description><![CDATA[I&#8217;m finally responding to Buffalo&#8217;s perspective on my last post about &#8220;Brilliant programmers.&#8221;  I didn&#8217;t say anything at first because I couldn&#8217;t think of anything insightful to say.  I still can&#8217;t, so I&#8217;m going to have to just make shit up.
Buffalo approaches the question from an educator&#8217;s perspective:
The real million dollar question in [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m finally responding to <a href="http://technofetish.net/buffaloblog/?p=88">Buffalo&#8217;s perspective</a> on my last post about &#8220;Brilliant programmers.&#8221;  I didn&#8217;t say anything at first because I couldn&#8217;t think of anything insightful to say.  I still can&#8217;t, so I&#8217;m going to have to just make shit up.</p>
<p>Buffalo approaches the question from an educator&#8217;s perspective:</p>
<blockquote><p>The real million dollar question in my mind, Josh, is what are these super-programmers doing that others are not? Even if there’s just something irreproducible in their genes - shouldn’t this be the sort of thing we could detect somehow? Or if there are strategies involved, could we use them to make the 90 percentile 5x better than everybody else?</p>
<p>[&#8230;]</p>
<p>Which of course brings me around to my research - say you had a group of the 50 cs students who enter an average program around the country. And say your goal was to get absolutely as many of them as possible into that 5% and screw everything else. What would you say to them? What would you do with them?</p></blockquote>
<p>I guess it&#8217;s depressing to put this way, but my true belief is that programmers are born, not made.  So I think the absolute number one thing a CS education can do for its students is help them understand whether they were born programmers or not.</p>
<p>This isn&#8217;t a binary thing, of course, and I don&#8217;t even think it&#8217;s single-dimensional. Everyone has areas of strength and weakness.  And it&#8217;s a big world out there &#8212; succeeding at Amazon or Microsoft or Google is different than succeeding in the consulting world or at a startup or the technology department of an unrelated industry.  I know at least one person who is a decent programmer but is doing quite well by combining good business understanding and fantastic people skills with his competent but not outstanding technical background.  There are a lot of paths for people to take.</p>
<p>Then there is the question of what productivity is.  In a corporate setting, productivity is making progress toward keeping your customer happy, whoever your customer may be and however bizarre their wants.  Well I doubt that writing a self-compiling C compiler or figuring out how to calculate pi was at the top of any customer&#8217;s wishlist.  Fabrice Bellard, for all his badassery, could end up being fairly unremarkable when you put him in a cube and tell him to write web applications.  Or he might find it excruciating and spend the whole time inventing a framework that lets him write web apps the way he thinks.  After all, that&#8217;s what Paul Graham did.</p>
<p>So disclaim, disclaim, disclaim.  My point so far is just to highlight what is probably already obvious: that the landscape of talent is complex and multidimensional.</p>
<p>That said, I think it&#8217;s really key that students understand their strengths and weaknesses as early as possible.  It will help them decide whether CS is right for them, and if it is what direction they should go within CS.  And the best way to achieve this understanding is to expose students to lots of different things.  As a bonus, this is also exactly what the overachievers need and want too; more problems to feast their minds on.  So if I could sum it up in a word, I think the number one thing that university can do is expose young programmers to lots of topics and give them feedback about how they do in each one.</p>
<p>As to how we can help budding programmers be in the super-productive elite?  I&#8217;m somewhat hesitant to answer that question, because I feel the answer reveals what the answerer thinks makes him/her a member of this elite class.  But my biased answer is that the #1 most valuable trait a programmer can have is resourcefulness.  It&#8217;s knowing what&#8217;s out there &#8212; what tools, strategies, file formats, blogs, or best practices  &#8212; and knowing how they apply to the problem in front of you.  If some programmers truly are outperforming others by 20x, it&#8217;s not because they&#8217;re typing 20x faster &#8212; it&#8217;s because they have such a solid understanding of the problem&#8217;s context that they have laser-like focus on the shortest possible path between them and their goal.</p>
<p>On the flip side, I think the worst thing that can happen for programmers is for them to get caught in their own little worlds where they only know one way of dealing with problems.  Java-only programmers are the easiest to pick on example of this vice, but not the only one.  You can probably get by only using/liking Java if you work at an all-Java shop where you are a cog in a machine, but you&#8217;ll never have any perspective of the big picture.  I think we all fall prey to getting comfortable with our favorite languages/tools and thinking of everything through those lenses, but the more we can avoid that, the better we do IMO.</p>
<p>So that&#8217;s my answer: show students what&#8217;s out there, and encourage them to be resourceful.  If there is any trace of programmer in them, it will come to life and demand that you feed it more.  Anyone who doesn&#8217;t self-motivate at that point is not destined to be a programmer.  They might not have the talent, or they might have the talent but not the motivation; either way, they probably should find something else instead.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.reverberate.org/2008/02/12/more-thoughts-on-good-programmers/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
