<?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>weaselhat &#187; Blog</title>
	<atom:link href="http://www.weaselhat.com/category/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.weaselhat.com</link>
	<description></description>
	<lastBuildDate>Wed, 01 Feb 2012 20:18:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>@mgrnbrg on twitter</title>
		<link>http://www.weaselhat.com/2012/02/01/mgrnbrg-on-twitter/</link>
		<comments>http://www.weaselhat.com/2012/02/01/mgrnbrg-on-twitter/#comments</comments>
		<pubDate>Wed, 01 Feb 2012 16:07:58 +0000</pubDate>
		<dc:creator>Michael Greenberg</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://www.weaselhat.com/?p=318</guid>
		<description><![CDATA[Just a note: I&#8217;ve had a (mostly idle) Twitter account for a while, @mgrnbrg. Feel free to say hello!]]></description>
			<content:encoded><![CDATA[<p>Just a note: I&#8217;ve had a (mostly idle) Twitter account for a while, <a href="https://twitter.com/#!/mgrnbrg">@mgrnbrg</a>.  Feel free to say hello!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.weaselhat.com/2012/02/01/mgrnbrg-on-twitter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lovelace and Babbage vs. The Organist</title>
		<link>http://www.weaselhat.com/2011/01/19/lovelace-and-babbage-vs-the-organist/</link>
		<comments>http://www.weaselhat.com/2011/01/19/lovelace-and-babbage-vs-the-organist/#comments</comments>
		<pubDate>Wed, 19 Jan 2011 19:33:35 +0000</pubDate>
		<dc:creator>Michael Greenberg</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://www.weaselhat.com/?p=245</guid>
		<description><![CDATA[The latest and longest-yet episode of the graphic novel Lovelace and Babbage&#8212;Lovelace and Babbage vs. the Organist&#8212;at 2D Goggles has come to a close. If you haven&#8217;t seen it before, check it out! I highly recommend it.]]></description>
			<content:encoded><![CDATA[<p>The latest and longest-yet episode of the graphic novel Lovelace and Babbage&#8212;Lovelace and Babbage vs. the Organist&#8212;at <a href="http://2dgoggles.com/">2D Goggles</a> has come to a close.  If you haven&#8217;t seen it before, check it out!  I highly recommend it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.weaselhat.com/2011/01/19/lovelace-and-babbage-vs-the-organist/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nested functions in GCC</title>
		<link>http://www.weaselhat.com/2010/03/03/nested-functions-in-gcc/</link>
		<comments>http://www.weaselhat.com/2010/03/03/nested-functions-in-gcc/#comments</comments>
		<pubDate>Wed, 03 Mar 2010 16:06:40 +0000</pubDate>
		<dc:creator>Michael Greenberg</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Programming Languages]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.weaselhat.com/?p=208</guid>
		<description><![CDATA[GCC supports &#8220;nested functions&#8221; using the -fnested-functions flag. When I first saw this, I was excited: closures in C! In the famous words of Admiral Ackbar, &#8220;it&#8217;s a trap!&#8221; C [Show Styled Code]: #include typedef int (*fptr)(int); fptr f(int arg) { int nested_function(int nested_arg) { return arg + nested_arg; } return &#038;nested_function; } void smash(int [...]]]></description>
			<content:encoded><![CDATA[<p>GCC supports &#8220;nested functions&#8221; using the <tt>-fnested-functions</tt> flag.  When I first saw this, I was excited: closures in C!  In the famous words of Admiral Ackbar, &#8220;it&#8217;s a trap!&#8221;</p>
<div class="synthi_code" style="display:none;" id ="plain_synthi_4f2d1ab57a91a">
<div class="synthi_header" style="font-weight:bold;"> C <span  class="synthi_button"style="font-weight:lighter;font-size:smaller;">[<a href="#" onClick="javascript:document.getElementById('styled_synthi_4f2d1ab57a91a').style.display='block';document.getElementById('plain_synthi_4f2d1ab57a91a').style.display='none';return false">Show Styled Code</a>]:</span></div>
<pre style="width:100%;overflow:auto;">
#include <stdio.h>

typedef int (*fptr)(int);

fptr f(int arg) {
  int nested_function(int nested_arg) {
    return arg + nested_arg;
  }

  return &#038;nested_function;
}

void smash(int arg) {
  return;
}

int main(void) {
  fptr g = f(10);
  printf(&#034;%d\n&#034;, (*g)(5));
  smash(12);
  // printf(&#034;%d\n&#034;, (*g)(5));
  fptr h = f(12);
  printf(&#034;%d\n&#034;, (*g)(5));
  printf(&#034;%d\n&#034;, (*h)(5));

  return 0;
}
</pre>
</div>
<div class="synthi_code" style="display:block;" id ="styled_synthi_4f2d1ab57a91a">
<div class="synthi_header" style="font-weight:bold;"> C <span  class="synthi_button"style="font-weight:lighter;font-size:smaller;">[<a href="#" onClick="javascript:document.getElementById('plain_synthi_4f2d1ab57a91a').style.display='block';document.getElementById('styled_synthi_4f2d1ab57a91a').style.display='none';return false">Show Plain Code</a>]:</span></div>
<div class="c" style="font-family: monospace;">
<ol>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #339933;">#include &lt;stdio.h&gt;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333;">typedef</span> <span style="color: #993333;">int</span> <span style="color: #66cc66;">&#40;</span>*fptr<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#40;</span><span style="color: #993333;">int</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">fptr f<span style="color: #66cc66;">&#40;</span><span style="color: #993333;">int</span> arg<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #993333;">int</span> nested_function<span style="color: #66cc66;">&#40;</span><span style="color: #993333;">int</span> nested_arg<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #b1b100;">return</span> arg + nested_arg;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #b1b100;">return</span> &amp;nested_function;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333;">void</span> smash<span style="color: #66cc66;">&#40;</span><span style="color: #993333;">int</span> arg<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #b1b100;">return</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333;">int</span> main<span style="color: #66cc66;">&#40;</span><span style="color: #993333;">void</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; fptr g = f<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">10</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <a href="http://www.opengroup.org/onlinepubs/009695399/functions/printf.html"><span style="color: #000066;">printf</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;%d<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>, <span style="color: #66cc66;">&#40;</span>*g<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">5</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; smash<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">12</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #808080; font-style: italic;">// printf(&quot;%d\n&quot;, (*g)(5));</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; fptr h = f<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">12</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <a href="http://www.opengroup.org/onlinepubs/009695399/functions/printf.html"><span style="color: #000066;">printf</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;%d<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>, <span style="color: #66cc66;">&#40;</span>*g<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">5</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <a href="http://www.opengroup.org/onlinepubs/009695399/functions/printf.html"><span style="color: #000066;">printf</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;%d<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>, <span style="color: #66cc66;">&#40;</span>*h<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">5</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #b1b100;">return</span> <span style="color: #cc66cc;">0</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
<p>Try compiling (<tt>gcc -fnested-functions</tt>).  What does the second call to <tt>g</tt> produce&#8212;15 or 17?  Try uncommenting line 21.  What happens?  Does commenting out line 20 affect this?  What if line 19 is commented out, but lines 20 and 21 are uncommented?</p>
<p>I&#8217;m not sure this feature is worth it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.weaselhat.com/2010/03/03/nested-functions-in-gcc/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Type theory comes of age</title>
		<link>http://www.weaselhat.com/2010/02/12/type-theory-comes-of-age/</link>
		<comments>http://www.weaselhat.com/2010/02/12/type-theory-comes-of-age/#comments</comments>
		<pubDate>Fri, 12 Feb 2010 15:18:37 +0000</pubDate>
		<dc:creator>Michael Greenberg</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://www.weaselhat.com/?p=204</guid>
		<description><![CDATA[The current issue of the CACM has an article, Type theory comes of age. Not only is my advisor prominently depicted, but they also mention my area of research! Thanks to Nate Foster for pointing this out to me.]]></description>
			<content:encoded><![CDATA[<p>The current issue of the CACM has an article, <a href="http://portal.acm.org/citation.cfm?id=1646353.1646361&#038;coll=portal&#038;dl=ACM">Type theory comes of age</a>.  Not only is my <a href="http://www.cis.upenn.edu/~bcpierce/">advisor</a> prominently depicted, but they also mention my area of research!</p>
<p>Thanks to <a href="http://www.cs.princeton.edu/~jnfoster/">Nate Foster</a> for pointing this out to me.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.weaselhat.com/2010/02/12/type-theory-comes-of-age/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Gravatar support</title>
		<link>http://www.weaselhat.com/2009/05/31/gravatar/</link>
		<comments>http://www.weaselhat.com/2009/05/31/gravatar/#comments</comments>
		<pubDate>Sun, 31 May 2009 18:40:14 +0000</pubDate>
		<dc:creator>Michael Greenberg</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://www.weaselhat.com/?p=113</guid>
		<description><![CDATA[I&#8217;ve added gravatar support to the website. The gravatar system is a clever way to create identity on-line: e-mails are associated with images. Critically, the URL associated with an e-mail doesn&#8217;t include the e-mail itself, but instead an MD5 hash &#8212; this way, spammers can&#8217;t harvest your address. I was disappointed to discover that Google [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve added <a href="http://www.gravatar.com" title="The 'gr' makes it sound childish, even though it's a great idea.">gravatar</a> support to the website.  The gravatar system is a clever way to create identity on-line: e-mails are associated with images.  Critically, the <a href="http://en.gravatar.com/site/implement/url" title="There are other features, as well".>URL associated with an e-mail</a> doesn&#8217;t include the e-mail itself, but instead an MD5 hash &#8212; this way, spammers can&#8217;t harvest your address.</p>
<p>I was disappointed to discover that Google Chat doesn&#8217;t have support for gravatars &#8212; a Google labs feature I would use.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.weaselhat.com/2009/05/31/gravatar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The University of Pennsylvania</title>
		<link>http://www.weaselhat.com/2007/04/16/upenn/</link>
		<comments>http://www.weaselhat.com/2007/04/16/upenn/#comments</comments>
		<pubDate>Mon, 16 Apr 2007 21:27:37 +0000</pubDate>
		<dc:creator>Michael Greenberg</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://www.weaselhat.com/2007/04/16/upenn/</guid>
		<description><![CDATA[Last week I accepted the University of Pennsylvania&#8216;s offer to study for a PhD (in PL). A few cool people there: Benjamin Pierce Rajeev Alur Stephanie Weirich Steve Zdancewic Val Tannen Ben Taskar Fernando Pereira I&#8217;m really excited!]]></description>
			<content:encoded><![CDATA[<p>Last week I accepted the <a href="http://www.cis.upenn.edu" title="Mea nova mater, sed nondum alma, est.">University of Pennsylvania</a>&#8216;s offer to study for a PhD (in PL).  A few cool people there:</p>
<ul>
<li><a href="http://www.cis.upenn.edu/~bcpierce/" title="The man behind the lens -- quite literally.">Benjamin Pierce</a></li>
<li><a href="http://www.cis.upenn.edu/~alur/home.html" title="The man behind the...visibly pushdown automaton?">Rajeev Alur</a></li>
<li><a href="http://www.cis.upenn.edu/~sweirich/" title="The woman behind the types.">Stephanie Weirich</a></li>
<li><a href="http://www.cis.upenn.edu/~stevez/" title="The man behind the information flow.">Steve Zdancewic</a></li>
<li><a href="http://www.cis.upenn.edu/~val/home.html" title="The tallest database researcher I've ever met.">Val Tannen</a></li>
<li><a href="http://www.cis.upenn.edu/~taskar/" title="Ben was very good natured when I made fun of AI, and then totally schooled me on the history of Lisp.">Ben Taskar</a></li>
<li><a href="http://www.cis.upenn.edu/~pereira/" title="The man behind the department.">Fernando Pereira</a></li>
</ul>
<p>I&#8217;m really excited!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.weaselhat.com/2007/04/16/upenn/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>A New Term</title>
		<link>http://www.weaselhat.com/2007/01/22/new-term/</link>
		<comments>http://www.weaselhat.com/2007/01/22/new-term/#comments</comments>
		<pubDate>Mon, 22 Jan 2007 15:59:38 +0000</pubDate>
		<dc:creator>Michael Greenberg</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://www.weaselhat.com/2007/01/22/new-term/</guid>
		<description><![CDATA[A new term starts on Wednesday, but the following are all on the list for discussion: Dan Friedman, et al. The Reasoned Schemer Flapjax: lifting and a few growing pains My thesis]]></description>
			<content:encoded><![CDATA[<p>A new term starts on Wednesday, but the following are all on the list for discussion:</p>
<ol>
<li><a href="http://www.cs.indiana.edu/~dfried/">Dan Friedman</a>, et al. <a href="http://mitpress.mit.edu/catalog/item/default.asp?tid=10663&#038;ttype=2" class="paper">The Reasoned Schemer</a></li>
<li><a href="http://www.flapjax-lang.org/">Flapjax</a>: lifting and a few growing pains</li>
<li>My thesis</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.weaselhat.com/2007/01/22/new-term/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Weaselhat?</title>
		<link>http://www.weaselhat.com/2006/06/21/weaselhat/</link>
		<comments>http://www.weaselhat.com/2006/06/21/weaselhat/#comments</comments>
		<pubDate>Wed, 21 Jun 2006 16:07:57 +0000</pubDate>
		<dc:creator>Michael Greenberg</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://www.weaselhat.com/2006/05/27/test/</guid>
		<description><![CDATA[Harking to Mark Liberman of Language Log&#8216;s call for science blogs, I&#8217;ve started up this bit of silliness. I&#8217;m a computer science student, focusing on verification, temporal logic, and programming language theory. You know, the usual. The name is random, left over from software I used to write. I have my own image, but try [...]]]></description>
			<content:encoded><![CDATA[<p>Harking to Mark Liberman of <a href="http://itre.cis.upenn.edu/~myl/languagelog/">Language Log</a>&#8216;s call for science blogs, I&#8217;ve started up this bit of silliness.  I&#8217;m a computer science student, focusing on verification, temporal logic, and programming language theory.  You know, the usual.</p>
<p>The name is random, left over from software I used to write.  I have my own image, but try to free associate the two: weasel, hat; hat, weasel.  Yes, yes, that&#8217;s good.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.weaselhat.com/2006/06/21/weaselhat/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

