Another good thing to read about continuations is the continuation chapter of<div><br></div><div><a href="http://www.cs.brown.edu/~sk/Publications/Books/ProgLangs/">http://www.cs.brown.edu/~sk/Publications/Books/ProgLangs/</a></div>
<div><br></div><div>Here&#39;s my short take on &quot;why&quot; continuations for the Web:</div><div><br></div><div>* Due to HTTP&#39;s stateless nature, Web clients must &quot;remind&quot; Web servers of what the server was doing for the client. In any context, &quot;what was going to happen&quot; is the continuation of the computation.</div>
<div><br></div><div>* There are three ways to capture a continuation: incorrectly, correctly (manually), and correctly (automatically).</div><div><br></div><div>-- Incorrectly is what most people due by assigning a &quot;session&quot; id that makes it so each client can only be doing one thing and that thing is stored on the server and referenced by an identifier held by the client. This is incorrect because Web browsers can have many pages open, use the Back button, etc AND because storing things on the server like this increases resource usage.</div>
<div><br></div><div>-- Correctly (manually) is what most simple Web programs do. The programmer breaks up each step of the computation into a different PHP file (or function) and painstakingly records the environment of that step in hidden form values, URL parameters, etc. This manual process is difficult, error-prone, and frustrating, because it is so sensitive to the particular computation and almost entirely administrative labor.</div>
<div><br></div><div>-- Correctly (automatically) is what the Racket Web server provides: you write your application as if HTTP were stateful and it compiles (or runs) it using the constraint of real HTTP. You never need to think about what is left to do, what free identifiers there are, etc.</div>
<div><br></div><div>* Basically, continuations make Web programming like normal programming on the console. You don&#39;t really need to know anything special. It&#39;s the hardest for people who have used other Web frameworks because almost everything they do is now unnecessary, so you keep thinking that you need a way to make a &quot;session&quot; (or something) and you&#39;ll never see one.</div>
<div><br></div><div>That said, the Racket Web server does not force you to use these features. You can &quot;program Fortan in any language&quot; and write a PHP program. You make prefer Racket-PHP to normal PHP, but some things will be annoying, like having to bake your own session management. I find that most Racket apps use continuations directly in very few situations (multi-page forms) but mainly use the ability to bind a closure to a link a lot (although this features needs continuations inside its implementation). [This is the difference between send/suspend and send/suspend/dispatch... roughly.]</div>
<div><br></div><div>Jay <br><br><div class="gmail_quote">On Mon, Dec 12, 2011 at 2:40 AM, Gerry Weaver <span dir="ltr">&lt;<a href="mailto:gerryw@compvia.com">gerryw@compvia.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Neil,<br>
<br>
Thanks for the link. It was VERY helpful. It does answer the &quot;why&quot; part of the question, but not necessarily the &quot;if&quot; part. I&#39;m thinking in terms of a real world application and it&#39;s maintainability. It seems while a particular problem was solved, the bar on the price of entry to the code was raised significantly. If the problem were to be solved in a way that would maintain a more conventional design, it would be accessible to a wider range of developers. There are many that struggle with understanding continuations (myself included). I was just trying to compare the benefits of a continuation based design versus a more conventional approach. At this point, I still think it would depend heavily on the specific use case and developer skill level. Don&#39;t get me wrong. It&#39;s very cool! However, if the goal were to make scheme based web development accessible to the masses, I don&#39;t think a<br>

continuation based design would be the right choice. I will continue to ponder this question as I become more proficient in the language. I think it is important to capture these kinds things when learning any new language. It&#39;s a moment that will never come again. It seems I will inevitably reach a point where I am no longer able to evaluate things like this objectively.   <br>

<div class="im"><br>
<br>
Thanks,<br>
Gerry<br>
<br>
-----Original Message----- <br>
&gt; From: &quot;Neil Van Dyke&quot; &lt;<a href="mailto:neil@neilvandyke.org">neil@neilvandyke.org</a>&gt;<br>
</div><div class="im">&gt; To: &quot;Gerry Weaver&quot; &lt;<a href="mailto:gerryw@compvia.com">gerryw@compvia.com</a>&gt;<br>
&gt; Cc: <a href="mailto:users@racket-lang.org">users@racket-lang.org</a><br>
</div><div class="im">&gt; Date: 12/12/11 02:41<br>
&gt; Subject: Re: [racket] Racket Web Server<br>
&gt;<br>
</div><div><div></div><div class="h5">&gt; Gerry Weaver wrote at 12/12/2011 02:29 AM:<br>
&gt; &gt; What exactly are the benefits of a continuation based design?<br>
&gt;<br>
&gt; Does this paper address your questions?<br>
&gt;<br>
&gt; Krishnamurthi, Hopkins, McCarthy, Graunke, Pettyjohn, Felleisen,<br>
&gt; &quot;Implementation and Use of the PLT Scheme Web Server&quot;,<br>
&gt; Journal of Higher-Order and Symbolic Computing<br>
&gt; <a href="http://www.ccs.neu.edu/racket/pubs/#hosc-07" target="_blank">http://www.ccs.neu.edu/racket/pubs/#hosc-07</a><br>
&gt; <a href="http://www.ccs.neu.edu/racket/pubs/hosc07-sk-mf.pdf" target="_blank">http://www.ccs.neu.edu/racket/pubs/hosc07-sk-mf.pdf</a><br>
&gt;<br>
&gt; --<br>
&gt; <a href="http://www.neilvandyke.org/" target="_blank">http://www.neilvandyke.org/</a><br>
<br>
<br>
<br>
<br>
_________________________________________________<br>
  For list-related administrative tasks:<br>
  <a href="http://lists.racket-lang.org/listinfo/users" target="_blank">http://lists.racket-lang.org/listinfo/users</a></div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Jay McCarthy &lt;<a href="mailto:jay@cs.byu.edu" target="_blank">jay@cs.byu.edu</a>&gt;<br>
Assistant Professor / Brigham Young University<br><a href="http://faculty.cs.byu.edu/~jay" target="_blank">http://faculty.cs.byu.edu/~jay</a><br><br>&quot;The glory of God is Intelligence&quot; - D&amp;C 93<br>
</div>