<FONT FACE="Verdana" SIZE="2" COLOR="#000000" LETTERSPACING="0" KERNING="0"><br></FONT><FONT FACE="Verdana" SIZE="2" COLOR="#000000" LETTERSPACING="0" KERNING="0"><br></FONT><DIV ALIGN="LEFT"><FONT FACE="Verdana" SIZE="2" COLOR="#000000" LETTERSPACING="0" KERNING="0">On the subject of porting #lang racket&nbsp; to&nbsp; #lang web-server code </FONT></DIV><FONT FACE="Verdana" SIZE="2" COLOR="#000000" LETTERSPACING="0" KERNING="0"><br></FONT><DIV ALIGN="LEFT"><FONT FACE="Verdana" SIZE="2" COLOR="#000000" LETTERSPACING="0" KERNING="0">I provide a few lessons learned for the archives for the next person to attempt this. </FONT></DIV><FONT FACE="Verdana" SIZE="2" COLOR="#000000" LETTERSPACING="0" KERNING="0"><br></FONT><FONT FACE="Verdana" SIZE="2" COLOR="#000000" LETTERSPACING="0" KERNING="0"><br></FONT><DIV ALIGN="LEFT"><FONT FACE="Verdana" SIZE="2" COLOR="#000000" LETTERSPACING="0" KERNING="0"><B>1) Bindings, Serializability </B>, <B>and anonymous functions </B></FONT></DIV><FONT FACE="Verdana" SIZE="2" COLOR="#000000" LETTERSPACING="0" KERNING="0"><br></FONT><DIV ALIGN="LEFT"><FONT FACE="Verdana" SIZE="2" COLOR="#000000" LETTERSPACING="0" KERNING="0"><B>1A) the predicate serializable? from racket/serializable is invaluable </B></FONT></DIV><FONT FACE="Verdana" SIZE="2" COLOR="#000000" LETTERSPACING="0" KERNING="0"><br></FONT><DIV ALIGN="LEFT"><FONT FACE="Verdana" SIZE="2" COLOR="#000000" LETTERSPACING="0" KERNING="0">#lang web-server code will not transform if there are non-serializable constructs in the dynamic extent of the invocation of send/suspend </FONT></DIV><FONT FACE="Verdana" SIZE="2" COLOR="#000000" LETTERSPACING="0" KERNING="0"><br></FONT><DIV ALIGN="LEFT"><FONT FACE="Verdana" SIZE="2" COLOR="#000000" LETTERSPACING="0" KERNING="0">some minor surprises/lessons learned: </FONT></DIV><FONT FACE="Verdana" SIZE="2" COLOR="#000000" LETTERSPACING="0" KERNING="0"><br></FONT><DIV ALIGN="LEFT"><FONT FACE="Verdana" SIZE="2" COLOR="#000000" LETTERSPACING="0" KERNING="0"><B>1B) anonymous functions are not serializable </B></FONT></DIV><FONT FACE="Verdana" SIZE="2" COLOR="#000000" LETTERSPACING="0" KERNING="0"><br></FONT><DIV ALIGN="LEFT"><FONT FACE="Verdana" SIZE="2" COLOR="#000000" LETTERSPACING="0" KERNING="0">(serializable? (λ (x) x))&nbsp; ;-&gt;#f </FONT></DIV><FONT FACE="Verdana" SIZE="2" COLOR="#000000" LETTERSPACING="0" KERNING="0"><br></FONT><DIV ALIGN="LEFT"><FONT FACE="Verdana" SIZE="2" COLOR="#000000" LETTERSPACING="0" KERNING="0"><B>1C) anonymous functions in a list are not serializable </B></FONT></DIV><FONT FACE="Verdana" SIZE="2" COLOR="#000000" LETTERSPACING="0" KERNING="0"><br></FONT><DIV ALIGN="LEFT"><FONT FACE="Verdana" SIZE="2" COLOR="#000000" LETTERSPACING="0" KERNING="0">&nbsp;(serializable? (car (list (λ (x) x) (λ (x) x)))) ;-&gt;#f </FONT></DIV><FONT FACE="Verdana" SIZE="2" COLOR="#000000" LETTERSPACING="0" KERNING="0"><br></FONT><DIV ALIGN="LEFT"><FONT FACE="Verdana" SIZE="2" COLOR="#000000" LETTERSPACING="0" KERNING="0"><B>1D) once given a module-level binding, anonymous functions become serializable </B></FONT></DIV><FONT FACE="Verdana" SIZE="2" COLOR="#000000" LETTERSPACING="0" KERNING="0"><br></FONT><DIV ALIGN="LEFT"><FONT FACE="Verdana" SIZE="2" COLOR="#000000" LETTERSPACING="0" KERNING="0">(define foo (list (λ (x) x) (λ (x) x))) </FONT></DIV><FONT FACE="Verdana" SIZE="2" COLOR="#000000" LETTERSPACING="0" KERNING="0"><br></FONT><DIV ALIGN="LEFT"><FONT FACE="Verdana" SIZE="2" COLOR="#000000" LETTERSPACING="0" KERNING="0">(serializable? (car foo))&nbsp; ;-&gt;#t </FONT></DIV><FONT FACE="Verdana" SIZE="2" COLOR="#000000" LETTERSPACING="0" KERNING="0"><br></FONT><DIV ALIGN="LEFT"><FONT FACE="Verdana" SIZE="2" COLOR="#000000" LETTERSPACING="0" KERNING="0"><B>1E)&nbsp; void is not&nbsp; serializable </B></FONT></DIV><FONT FACE="Verdana" SIZE="2" COLOR="#000000" LETTERSPACING="0" KERNING="0"><br></FONT><DIV ALIGN="LEFT"><FONT FACE="Verdana" SIZE="2" COLOR="#000000" LETTERSPACING="0" KERNING="0">(serializable? void) ;-&gt;#f </FONT></DIV><FONT FACE="Verdana" SIZE="2" COLOR="#000000" LETTERSPACING="0" KERNING="0"><br></FONT><DIV ALIGN="LEFT"><FONT FACE="Verdana" SIZE="2" COLOR="#000000" LETTERSPACING="0" KERNING="0"><B>1F) anonymous functions bound within a letrec form are serializable </B></FONT></DIV><DIV ALIGN="LEFT"><FONT FACE="Verdana" SIZE="2" COLOR="#000000" LETTERSPACING="0" KERNING="0">&nbsp; </FONT></DIV><FONT FACE="Verdana" SIZE="2" COLOR="#000000" LETTERSPACING="0" KERNING="0"><br></FONT><DIV ALIGN="LEFT"><FONT FACE="Verdana" SIZE="2" COLOR="#000000" LETTERSPACING="0" KERNING="0"><B>2) 'attempt to cross a continuation barrier' exceptions </B></FONT></DIV><FONT FACE="Verdana" SIZE="2" COLOR="#000000" LETTERSPACING="0" KERNING="0"><br></FONT><DIV ALIGN="LEFT"><FONT FACE="Verdana" SIZE="2" COLOR="#000000" LETTERSPACING="0" KERNING="0">invocations of native continuations reified with call/cc seemed to frequently throw this error </FONT></DIV><FONT FACE="Verdana" SIZE="2" COLOR="#000000" LETTERSPACING="0" KERNING="0"><br></FONT><DIV ALIGN="LEFT"><FONT FACE="Verdana" SIZE="2" COLOR="#000000" LETTERSPACING="0" KERNING="0">I haven't done enough analysis to understand why and under what conditions, but in all cases I was able to remediate by enclosing the invocation as follows. </FONT></DIV><FONT FACE="Verdana" SIZE="2" COLOR="#000000" LETTERSPACING="0" KERNING="0"><br></FONT><DIV ALIGN="LEFT"><FONT FACE="Verdana" SIZE="2" COLOR="#000000" LETTERSPACING="0" KERNING="0">&nbsp;(call-with-continuation-prompt&nbsp; k (default-continuation-prompt-tag) </FONT></DIV><FONT FACE="Verdana" SIZE="2" COLOR="#000000" LETTERSPACING="0" KERNING="0"><br></FONT><DIV ALIGN="LEFT"><FONT FACE="Verdana" SIZE="2" COLOR="#000000" LETTERSPACING="0" KERNING="0"><B>3) with-continuation-marks, continuation-marks, and current-continuation-marks can be used to replace dynamic-wind </B></FONT></DIV><FONT FACE="Verdana" SIZE="2" COLOR="#000000" LETTERSPACING="0" KERNING="0"><br></FONT><FONT FACE="Verdana" SIZE="2" COLOR="#000000" LETTERSPACING="0" KERNING="0"><br></FONT><DIV ALIGN="LEFT"><FONT FACE="Verdana" SIZE="2" COLOR="#000000" LETTERSPACING="0" KERNING="0">Again, thank you. I think the stateless web-language is important technology and must have required an enormous amount of work to implement. </FONT></DIV><FONT FACE="Verdana" SIZE="2" COLOR="#000000" LETTERSPACING="0" KERNING="0"><br></FONT><DIV ALIGN="LEFT"><FONT FACE="Verdana" SIZE="2" COLOR="#000000" LETTERSPACING="0" KERNING="0">Anedcotally, application speed seems at or better than the stateful code. </FONT></DIV><FONT FACE="Verdana" SIZE="2" COLOR="#000000" LETTERSPACING="0" KERNING="0"><br></FONT><DIV ALIGN="LEFT"><FONT FACE="Verdana" SIZE="2" COLOR="#000000" LETTERSPACING="0" KERNING="0">R./ </FONT></DIV><DIV ALIGN="LEFT"><FONT FACE="Verdana" SIZE="2" COLOR="#000000" LETTERSPACING="0" KERNING="0">Zack </FONT></DIV><FONT FACE="Verdana" SIZE="2" COLOR="#000000" LETTERSPACING="0" KERNING="0"><br></FONT><DIV ALIGN="LEFT"><FONT FACE="Verdana" SIZE="2" COLOR="#000000" LETTERSPACING="0" KERNING="0">On Sun, Jan 1, 2012 at 4:36 PM, Jay McCarthy wrote: </FONT></DIV><FONT FACE="Verdana" SIZE="2" COLOR="#000000" LETTERSPACING="0" KERNING="0"><br></FONT><DIV ALIGN="LEFT"><FONT FACE="Verdana" SIZE="2" COLOR="#000000" LETTERSPACING="0" KERNING="0">&gt; On Sat, 31 Dec 2011 20:03:02 -0600,Robby Findler &lt;robby@eecs.northwestern.edu&gt; mumbled: </FONT></DIV><DIV ALIGN="LEFT"><FONT FACE="Verdana" SIZE="2" COLOR="#000000" LETTERSPACING="0" KERNING="0">&gt; &gt; I'm not sure if the web-server supports continuation marks or not </FONT></DIV><DIV ALIGN="LEFT"><FONT FACE="Verdana" SIZE="2" COLOR="#000000" LETTERSPACING="0" KERNING="0">&gt; </FONT></DIV><DIV ALIGN="LEFT"><FONT FACE="Verdana" SIZE="2" COLOR="#000000" LETTERSPACING="0" KERNING="0">&gt; The stateless transformation does support continuation marks, provided </FONT></DIV><DIV ALIGN="LEFT"><FONT FACE="Verdana" SIZE="2" COLOR="#000000" LETTERSPACING="0" KERNING="0">&gt; the keys and values are serializable. (Parameters/exception handlers are not </FONT></DIV><DIV ALIGN="LEFT"><FONT FACE="Verdana" SIZE="2" COLOR="#000000" LETTERSPACING="0" KERNING="0">&gt; supported because the key is not serializable.) </FONT></DIV><DIV ALIGN="LEFT"><FONT FACE="Verdana" SIZE="2" COLOR="#000000" LETTERSPACING="0" KERNING="0">&gt; </FONT></DIV><DIV ALIGN="LEFT"><FONT FACE="Verdana" SIZE="2" COLOR="#000000" LETTERSPACING="0" KERNING="0">&gt; Jay </FONT></DIV>