<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="/stylesheets/rss.css" type="text/css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Tom Moertel's Weblog: Tag oleg</title>
    <link>http://blog.moertel.com/articles/tag/oleg?tag=oleg</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Quality rants on programming theory and stuff geeks like</description>
    <item>
      <title>Oleg's great way of explaining delimited continuations</title>
      <description>&lt;p&gt;There&amp;#8217;s a great way to explain delimited continuations in the notes of &lt;a href="http://okmij.org/ftp/Computation/Continuations.html#shift-cgi"&gt;Oleg&amp;#8217;s Continuation Fest talk on using delimited continuations for &lt;span class="caps"&gt;CGI&lt;/span&gt; programming&lt;/a&gt;.  Just so it doesn&amp;#8217;t get overlooked, here it is:&lt;/p&gt;


&lt;blockquote&gt;I&amp;#8217;m obsessed in pointing out that every programmer already knows
and understands the delimited continuations; they might not know that
word though.  Everyone knows that when a process executes a system
call like &lt;code&gt;read&lt;/code&gt;, it gets &lt;em&gt;suspended&lt;/em&gt;. When the disk
delivers the data, the process is &lt;em&gt;resumed&lt;/em&gt;. That suspension of a
process is its continuation. It is delimited: it is not the
check-point of the whole OS, it is the check-point of a process only,
from the invocation of &lt;code&gt;main()&lt;/code&gt; up to the point
&lt;code&gt;main()&lt;/code&gt; returns. Normally these suspensions are resumed
only once, but can be zero times (&lt;code&gt;exit&lt;/code&gt;) or twice
(&lt;code&gt;fork&lt;/code&gt;).&lt;/blockquote&gt;

&lt;p&gt;I especially like the final part about &lt;code&gt;exit&lt;/code&gt; and
&lt;code&gt;fork&lt;/code&gt;, which drives home the notion that something more
subtle than returning from a typical function call is going on. If
anybody is confused over what &lt;em&gt;suspended&lt;/em&gt; means, that last part
ought to clear things up.&lt;/p&gt;

&lt;p&gt;The next time I need to explain delimited continuations, I know how
I&amp;#8217;m going to do it.&lt;/p&gt;</description>
      <pubDate>Mon, 05 May 2008 09:58:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:9030a189-530b-48b3-b5e1-ed41ab5c2467</guid>
      <author>Tom Moertel</author>
      <link>http://blog.moertel.com/articles/2008/05/05/olegs-great-way-of-explaining-delimited-continuations</link>
      <category>functional programming</category>
      <category>continuations</category>
      <category>fp</category>
      <category>oleg</category>
      <trackback:ping>http://blog.moertel.com/articles/trackback/724</trackback:ping>
    </item>
  </channel>
</rss>
