<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
   <channel>
      <title>Ezra&apos;s Research</title>
      <link>http://ezrakilty.net/research/</link>
      <description>Progamming languages. Ezra Cooper.</description>
      <language>en</language>
      <copyright>Copyright 2008</copyright>
      <lastBuildDate>Mon, 13 Oct 2008 13:14:19 +0100</lastBuildDate>
      <generator>http://www.sixapart.com/movabletype/?v=3.33</generator>
      <docs>http://blogs.law.harvard.edu/tech/rss</docs> 

            <item>
         <title>ECMAScript 4 &amp; Apple&apos;s resistance</title>
         <description><![CDATA[Because I'm out of the loop with my head in a thesis, I was surprised to hear about the <a href="http://lambda-the-ultimate.org/node/3047">dropping of tail calls in the plans for ECMAScript 4</a>. There's a bit of interesting discussion on tail calls on that thread before it wanders off into general pure/impure flames. One gem is a Google Docs spreadsheet which shows the <a href="http://spreadsheets.google.com/pub?key=pFIHldY_CkszsFxMkQOReAQ&gid=2">ECMA industrial members' votes on various proposals</a>, including Apple's bleeding-red No column. That reads to me as an uncharacteristic resistance to innovation from Apple.]]></description>
         <link>http://ezrakilty.net/research/2008/10/ecmascript_4_apples_resistance.html</link>
         <guid>http://ezrakilty.net/research/2008/10/ecmascript_4_apples_resistance.html</guid>
         <category>Programming Languages</category>
         <pubDate>Mon, 13 Oct 2008 13:14:19 +0100</pubDate>
      </item>
            <item>
         <title>Formlets; Idioms, arrows and monads </title>
         <description><![CDATA[<p>[UPDATE: The broken link to "The Essence of Form Abstraction" has been fixed. Sorry!]</p>

<p>For the first time in three years of research, I'm really proud of a paper that I worked on with my research group: <a href="/research/files/formlets-aplas-08.pdf">The Essence of Form Abstraction</a>, by Ezra Cooper, Sam Lindley, Philip Wadler and Jeremy Yallop, to be published in APLAS 2008. The paper shows how you can create compositional HTML forms which package up their data in any desired type. It shows an OCaml implementation but we also use the idea in our web-centric language, <a href="http://groups.inf.ed.ac.uk/links/">Links</a>.</p>

<p>Though this is the first good group work that I've contributed to, the others have been doing some great work. In particular, Jeremy, Sam, and Phil did some nice work characterizing the expressive power of idioms, arrows, and monads. They first defined a metalanguage, like Moggi's monadic metalanguage, which can encompass all three notions, in <a href="http://homepages.inf.ed.ac.uk/wadler/papers/arrows/arrows.pdf">The Arrow Calculus</a>, by Sam Lindley, Philip Wadler and Jeremy Yallop (unarchived). Then they showed the hierarchy of the three, under which idioms are the loosest interface but therefore their language is the strictest to program with, and monads are the strictest interface, therefore their language is the most free, and arrows can be seen as lying in between. The work is described in <a href="http://homepages.inf.ed.ac.uk/wadler/papers/arrows-and-idioms/arrows-and-idioms.pdf">Idioms are Oblivious, Arrows are Meticulous, Monads are Promiscuous</a> (ibid.), MSFP 2008.</p>

<p>To summarize this, you can see the arrow calculus as a syntax like the <code>do</code> notation of Haskell:</p>

<pre><code>do y &lt;- f x
   z &lt;- g y x
   return (h x y z)
</code></pre>

<p>Now to put the result crudely, monads allow expressions like the above, where the value bound at each step can be used in all future steps (this makes them "promiscuous"). The use of arrows restricts this so that the value bound at each step can be used <em>only</em> at the next step, as in:</p>

<pre><code>do y &lt;- f x
   z &lt;- g y x
   return (j x z)  -- y cannot be used here
</code></pre>

<p>You can still use arrow operations to manually pass data forward through each step, but this is a nuisance. Hence Lindley, Wadler and Yallop coined the term "meticulous" to describe arrows.</p>

<p>The idiom laws restrict this further so that each value can be used <em>only</em> in a final <code>return</code> clause (the <code>return</code> clause is "oblivious"):</p>

<pre><code>do y &lt;- f x
   z &lt;- k x        -- y cannot be used here
   return (h x y z)
</code></pre>

<p>An astute reader will note that <code>return</code> is not required in <code>do</code> syntax. What happens if there is no <code>return</code> clause? Then you can add one:</p>

<pre><code>do y &lt;- f x
   z &lt;- k x
   q
</code></pre>

<p>is equivalent to</p>

<pre><code>do y &lt;- f x
   z &lt;- k y x
   result &lt;- q
   return result
</code></pre>

<p>But either way the idiom laws require that <code>q</code> cannot depend on <code>y</code> or <code>z</code>.</p>

<p>This shows that the three notions progressively restrict (and fairly naturally) the ways that you can program with them. But, in a familiar appearance of contravariance, the notions are reverse-ordered in how restrictive they are to <em>create</em>. An idiom, being the most restrictive on its user, is least restrictive to its writer. Thus you can model some computational notions as idioms which you could not model as monads. This fact came in handy in our latest paper, where we used idioms to model form abstraction.</p>

<p>I encourage you all to read about idioms, arrows and monads, as it's turning out to be a very nice theory.</p>
]]></description>
         <link>http://ezrakilty.net/research/2008/09/formlets_idioms_arrows_and_mon.html</link>
         <guid>http://ezrakilty.net/research/2008/09/formlets_idioms_arrows_and_mon.html</guid>
         <category>Programming Languages</category>
         <pubDate>Fri, 12 Sep 2008 13:04:05 +0100</pubDate>
      </item>
            <item>
         <title>motor sounds</title>
         <description><![CDATA[<p>Overheard on <code>#haskell</code>:</p>

<blockquote>
  <p>newsham: > let motor sounds = sounds "vroom! " in motor cycle</p>
  
  <p>lambdabot:
    "vroom! vroom! vroom! vroom! vroom! vroom! vroom! vroom! vroom! vroom! vroo...</p>
</blockquote>
]]></description>
         <link>http://ezrakilty.net/research/2008/09/motor_sounds.html</link>
         <guid>http://ezrakilty.net/research/2008/09/motor_sounds.html</guid>
         <category>Hacks</category>
         <pubDate>Tue, 09 Sep 2008 13:03:34 +0100</pubDate>
      </item>
            <item>
         <title>Der Hauptsatz</title>
         <description><![CDATA[<p>Had a good time today puzzling over Gerhard Gentzen's 1934 paper, "<a href="http://gdzdoc.sub.uni-goettingen.de/sub/digbib/loader?did=D17178">Untersuchungen über das logische Schließen. I</a>." ("Investigations into logical reasoning"). I wanted to determine that this was really what I thought it was: the paper where he introduced cut-elimination and the subformula property, which I'm examining now in my research.</p>

<p>I was looking at the German version and I don't know anything about German. But <a href="http://translate.google.com/translate_t#de|en">Google Translate</a> and the <a href="http://dict.tu-chemnitz.de/dings.cgi?lang=en;service=deen">BeoLingus</a> online DE-EN dictionary came to the rescue.  (<a href="http://homepages.inf.ed.ac.uk/~wadler">Phil</a> tells me he has a translation, but where's the fun in that?)</p>

<p>The result was satisfying:</p>

<blockquote>
  <p>Eine nähere Untersuchung der besonderen Eigenschaften des natürlich Kalküls fürte mich schließlich zu einem sehr allgemeinen Satz, den ich im folgenden "<span style="letter-spacing: 0.25em;">Hauptsat</span>z" nennen will. Der Hauptsatz besagt, dass sich jeder rein logische Beweis auf eine bestimmte, übrigens keineswegs eindeutige, Normalform bringen lässt.</p>
</blockquote>

<p>which I render,</p>

<blockquote>
  <p>A closer examination of the special properties of the natural calculus led me to a general theorem that I have called the `fundamental theorem'. The fundamental theorem says that any purely logical proof can be brought to a certain (incidentally, non-obvious) normal form.</p>
</blockquote>

<p>And much later, after introducing the natural deduction calculi for classical (NK) and intuitionistic logic (NJ), as well as the respective sequent calculi (LJ and LK), we get to this understated result:</p>

<blockquote>
  <p>Hauptsatz: Jede LJ- bzw. LK-Herleitung läßt sich in eine LJ- bzw. LK-Herleitung mit der gleichen Endsequenz umwandeln, in welcher die als <code>Schnitt</code> bezeichnete Schlußfigur nicht vorkommt.</p>
  
  <p>Every LJ- (resp. LK-)derivation can convert to a LJ- (resp., LK-)derivation with the same end sequent, in which the rule called ``snip'' does not appear.</p>
</blockquote>

<p>Instead of the usual name "cut," I've merrily translated the German "Schnitt" as "snip," because it pleases me--I like direct, etymological, native translations of this kind. (<a href="http://dictionary.oed.com/cgi/entry/50229231?query_type=word&amp;queryword=snip&amp;first=1&amp;max_to_show=10&amp;sort_type=alpha&amp;search_id=eaIm-iN5Coz-8777&amp;result_place=1">OED</a> traces the English "snip" to Low German "schnipp," not terribly far off; "cut" has, of course, OE origin.)</p>

<p>(Sadly, I can't remember where I got the PDF of this original. The browsable online version linked above is from Gentzen's own alma mater, Göttingen University.)</p>

<p>(Miscellanea: Fans of typographic history will appreciate the printer's use of <a href="http://en.wikipedia.org/wiki/Emphasis_(typography)#Letterspacing">letter spacing for emphasis</a>, a practice unknown in English but apparently traditional in German, according to Wikipedia. It could be used roughly wherever we use italics in English.)</p>
]]></description>
         <link>http://ezrakilty.net/research/2008/09/der_hauptsatz.html</link>
         <guid>http://ezrakilty.net/research/2008/09/der_hauptsatz.html</guid>
         <category>History</category>
         <pubDate>Thu, 04 Sep 2008 21:13:32 +0100</pubDate>
      </item>
            <item>
         <title>Discovery! \qedhere</title>
         <description><![CDATA[<p>Just made an exciting discovery! The TeX command <code>\qedhere</code> can be used within an AMS proof environment; it forces the proof-tombstone to go on the present line, whereas it would normally go after the end of the <code>\begin{proof}</code>/<code>\end{proof}</code> block, which often puts it outside an <code>itemize</code> or <code>enumerate</code> environment, looking ugly on a line of its own. Of course, the command properly suppresses the tombstone at the end of the <code>proof</code> environment. Ah comfort, O infinite luxury of macros!</p>
]]></description>
         <link>http://ezrakilty.net/research/2008/09/discovery_qedhere.html</link>
         <guid>http://ezrakilty.net/research/2008/09/discovery_qedhere.html</guid>
         <category>Research Writing</category>
         <pubDate>Mon, 01 Sep 2008 17:44:22 +0100</pubDate>
      </item>
            <item>
         <title>Sensible SQL: The second typing for grouped columns</title>
         <description><![CDATA[<p>SQL keeps turning out to be more sensible than I thought it was.</p>

<p>If you're like me, you thought that GROUP BY clauses partitioned your columns into "grouping columns" and "non-grouping columns" and that the MUST to be processed with aggregate functions (count, sum, max, min, average) and that the second MUST NOT be processed that way. This would have been a problem for converting Peyton Jones and Wadler's Comprehensive Comprehensions to SQL, since that technique uses a ncie uniform treatment of group-by clauses: they transform all the query's bound variables to list type for the remainder of the query. Example—here's a simple query that takes a table, groups it on values from columna a, and returns pairs of the value from a and the sum of the list of corresponding column b values:</p>

<pre><code>select a, sum(b) from t group by a
</code></pre>

<p>Fine and simple. And as you may know, the following produces an error:</p>

<pre><code>select a, b from t group by a
</code></pre>

<p>Because we've grouped on <code>a</code>, we can't just select column b within each grouping because there are multiple column b values. The DBMS will insist that we use an aggregate function to convert this collection to a primitive-type value. Such are the restrictions of the relational model.</p>

<p>But Peyton Jones and Wadler's proposal simply treats all columns, when grouped, as lists. So</p>

<pre><code>[(a, b) | (a, b) &lt;- t, group by a]
</code></pre>

<p>is a perfectly legal expression of type [([A], [B])] (letting A and B be the raw column types of a and b, resp.). What they expect you to do, to make SQLizable expressions, is to apply some other function to reduce each column, a typical example being</p>

<pre><code>[(the a, sum b) | (a, b) &lt;- t, group by a]
</code></pre>

<p>which corresponds to the first SQL query above: it collects the values from a and matches these with the sums of corresponding values from b. But the above syntax allows you to do things like this:</p>

<pre><code>[(sum a, sum b) | (a, b) &lt;- t, group by a]
</code></pre>

<p>which seems to correspond to SQL that applies an aggregate function to a grouped column as well as an ungrouped column. "Whither SQL!?" I worried! Yet all was not lost. SQL treats grouped columns as being alternately bag-typed or primitive-typed, depending on the context. So the following is a valid query:</p>

<pre><code>select sum(a), sum(b) from s group by a
</code></pre>

<p>Huzzah! This shows SQL to be in closer accordance with a sensible, uniform, orthogonal languge such as Peyton Jones and Wadler's than I'd imagined. In other ways, too, I keep finding it easier and easier to make SQL queries out of difficult FP expressions by using little-known SQL features. Cheers, guys.</p>
]]></description>
         <link>http://ezrakilty.net/research/2008/08/sensible_sql_the_second_typing.html</link>
         <guid>http://ezrakilty.net/research/2008/08/sensible_sql_the_second_typing.html</guid>
         <category>Databases</category>
         <pubDate>Wed, 27 Aug 2008 23:50:46 +0100</pubDate>
      </item>
            <item>
         <title>Slow blog year chez Ezra</title>
         <description>Hey, I haven&apos;t been blogging very much! Sorry about that, guys. It&apos;s just, well, research is so vague and inconclusive most of the time. But, I&apos;ll try and do better. Watch this space!</description>
         <link>http://ezrakilty.net/research/2008/08/slow_blog_year_chez_ezra.html</link>
         <guid>http://ezrakilty.net/research/2008/08/slow_blog_year_chez_ezra.html</guid>
         <category></category>
         <pubDate>Fri, 22 Aug 2008 14:54:10 +0100</pubDate>
      </item>
            <item>
         <title>NamedGZipStream, Covariance and Contravariance</title>
         <description><![CDATA[Favorite MSDN article title of the month: <a href="http://msdn.microsoft.com/en-us/magazine/cc163727.aspx">NamedGZipStream, Covariance and Contravariance</a>.</p>

<p>That's Microsoft, as always, blending the sublime and the ridiculous.</p>

<p>(Thanks also for the bogus etymology of "covariance": "In mathematics, covariance is a measure of the degree to which two variables move up or down together. The term was co-opted by the OO crowd to describe..." Way to overlook category theory, guys!)]]></description>
         <link>http://ezrakilty.net/research/2008/08/namedgzipstream_covariance_and.html</link>
         <guid>http://ezrakilty.net/research/2008/08/namedgzipstream_covariance_and.html</guid>
         <category>Programming Languages</category>
         <pubDate>Fri, 22 Aug 2008 14:50:34 +0100</pubDate>
      </item>
            <item>
         <title>Mitzenmacher&apos;s Theory Book</title>
         <description><![CDATA[<p>I like <a href="http://mybiasedcoin.blogspot.com/2008/04/theorycs-book.html">this vision Michael Miztenmacher is promoting for a book aimed at high school sophomores</a> that explains well-understood topics in theoretical CS and describes a big open problem in each area. Besides getting the word out about the great ideas we have, it could stir enthusiasm through the big looming problems.</p>

<p>When I was around that age, I gorged myself on A.&nbsp;K. Dewdney's <a href="http://www.antiqbook.co.uk/boox/lit/45470.shtml"><cite>The Turing Omnibus: 61 Excursions in Computer Science</cite></a> (now <a href="http://www.amazon.com/New-Turing-Omnibus-Sixty-Six-Excursions/dp/0805071660">66</a>), which treats a variety of topics very readably. It rotates around: one chapter might be on some kind of automaton and the next on an AI technique, but each area returns in time, so it develops each in chewable doses.</p>

<!--Theoretical CS languishes, I think, under a certain malaise. On the one hand it is not as timeless as pure math or physics, on the other hand it lacks worldly sex-appeal as compared with its practical counterpart.-->
]]></description>
         <link>http://ezrakilty.net/research/2008/04/i_like_this_vision_michael.html</link>
         <guid>http://ezrakilty.net/research/2008/04/i_like_this_vision_michael.html</guid>
         <category></category>
         <pubDate>Thu, 24 Apr 2008 23:46:06 +0100</pubDate>
      </item>
            <item>
         <title>null == undefined</title>
         <description><![CDATA[<p>(Salad with) Steve Jenson lays it down for you: the <a href="http://saladwithsteve.com/2008/02/javascript-undefined-vs-null.html"><code>null</code> vs. <code>undefined</code></a> nonsense in JavaScript. Better recognize.</p>
]]></description>
         <link>http://ezrakilty.net/research/2008/04/null_undefined.html</link>
         <guid>http://ezrakilty.net/research/2008/04/null_undefined.html</guid>
         <category>Programming Languages</category>
         <pubDate>Thu, 24 Apr 2008 23:20:36 +0100</pubDate>
      </item>
            <item>
         <title>Yhc : Haskell -&gt; JavaScript</title>
         <description><![CDATA[A <a href="http://yhc06.blogspot.com/2008/03/yhcjavascript-backend.html">note</a> on compiling Haskell to JavaScript, and interfacing with the DOM, in Yhc.]]></description>
         <link>http://ezrakilty.net/research/2008/04/yhc_haskell_javascript.html</link>
         <guid>http://ezrakilty.net/research/2008/04/yhc_haskell_javascript.html</guid>
         <category>Programming Languages</category>
         <pubDate>Mon, 14 Apr 2008 01:58:56 +0100</pubDate>
      </item>
            <item>
         <title>A located lambda calculus</title>
         <description><![CDATA[Oh right. Last week I submitted a paper to ICFP. Here it is: "<a href="/research/located-lambda.pdf">A located lambda calculus</a>," by Ezra elias kilty Cooper and Philip Wadler. The abstract:

<blockquote>
Several recent language designs have offered a unified language for
programming a distributed system; we call these “location-aware”
languages. These languages provide constructs that allow the programmer
to control the location (the choice of host, for example)
where a piece of code should run, which can be useful for security
or performance reasons. On the other hand, a central mantra
of web engineering insists that web servers should be “stateless”:
that no “session state” should be maintained on behalf of individual
clients—that is, no state that pertains to the particular point of
the interaction at which a client program resides. Thus far, most
implementations of unified location-aware languages have ignored
this precept, usually keeping a process for each client running on
the server, or otherwise storing state information in memory. We
show how to implement a location-aware language on top of the
stateless-server model.
</blockquote>]]></description>
         <link>http://ezrakilty.net/research/2008/04/a_located_lambda_calculus.html</link>
         <guid>http://ezrakilty.net/research/2008/04/a_located_lambda_calculus.html</guid>
         <category>Programming Languages</category>
         <pubDate>Sun, 13 Apr 2008 21:19:08 +0100</pubDate>
      </item>
            <item>
         <title>Huzzah</title>
         <description><![CDATA[It's customary to indicate the end of a proof with a little square (a "tombstone"), with "Q.E.D.," or elsewise. These marks almost never seem helpful to me, but there are other points where significant proof obligations are discharge, and I wish these were marked.</p>

<p>One instance is the end of a case, in a proof by cases. Each of these is a major branch of the proof, which dead-ends in the middle. Variables may be brought into scope, which evaporate when the case is completed, so it's important to know the bounds of that case.</p>

<p>My contribution, then, to the technique of proof-by-cases, is to introduce the marker "huzzah!" indicating the simple end of a case as well as one's excitement at having proven something—a miminal proof-unit, perhaps. Here it is in a screenshot:</p>

<p><img src="http://ezrakilty.net/research/huzzah.png" /></p>

<p>Having trouble achieving this effect yourself? Here's a TeX macro:</p>

<p>  \def\huzzah{\hfill\emph{huzzah!}}</p>

<p><strong>Update</strong>: According to Wikipedia, "<a href="http://en.wikipedia.org/wiki/Q.E.D.#Electronic_forms">Paul Sally at the University of Chicago is known for ending proofs with a pirate face symbol.</a>" This doesn't seem to be true of the couple of <a href="http://books.google.com/books?id=GuXp4rPkzyAC&pg=PA55&dq=foundations+of+mathematical+analysis+paul+sally&sig=TJQzk_XLU6kJHAgA18MYXRoauAg#PPA85,M1">book</a>s coauthored by Sally that I could get through Google Books.]]></description>
         <link>http://ezrakilty.net/research/2008/04/huzzah.html</link>
         <guid>http://ezrakilty.net/research/2008/04/huzzah.html</guid>
         <category>Pure Math</category>
         <pubDate>Thu, 03 Apr 2008 22:43:37 +0100</pubDate>
      </item>
            <item>
         <title>Bracha on Monkey Patching</title>
         <description><![CDATA[Gilad Bracha just gave an <a href="http://gbracha.blogspot.com/2008/03/monkey-patching.html">excellent overview of "monkey patching,"</a> or adding methods to a class from the outside, and other possible solutions to the same problem, none of which satisfy.]]></description>
         <link>http://ezrakilty.net/research/2008/03/bracha_on_monkey_patching.html</link>
         <guid>http://ezrakilty.net/research/2008/03/bracha_on_monkey_patching.html</guid>
         <category>Programming Languages</category>
         <pubDate>Thu, 27 Mar 2008 14:25:13 +0100</pubDate>
      </item>
            <item>
         <title>Fancy math, basics</title>
         <description><![CDATA[John Baez' enthusiasm is infectious, and his perspective appealing:</p>

<blockquote>
It's sort of hilarious that Ferro was solving cubic equations before negative numbers were worked out. It should serve as a lesson: we mathematicians often work on fancy stuff before understanding the basics. Often that's why math seemss hard! But often it's impossible to discover the basics except by working on fancy stuff and getting stuck.
<div class="attrib">—John Baez, <cite>This Week's Finds in Mathematical Physics</cite>, <a href="http://math.ucr.edu/home/baez/week261.html">Week 261</a>
</div>
</blockquote>
]]></description>
         <link>http://ezrakilty.net/research/2008/03/fancy_math_basics.html</link>
         <guid>http://ezrakilty.net/research/2008/03/fancy_math_basics.html</guid>
         <category>Pure Math</category>
         <pubDate>Fri, 21 Mar 2008 02:03:59 +0100</pubDate>
      </item>
      
   </channel>
</rss>
