<div dir="ltr">My plan is to synchronize MFlow servers using cloud Haskell since the state serialization is small. I´m working on it.  However continuation based frameworks can not synchronize state.  There is &quot;swarm&quot; in scala that generate portable continuations but this is not used in the context of web application since the state in a continuation is big and can not be synchronized fast enough. In other languages these states are not even portable between machines.</div>

<div class="gmail_extra"><br><br><div class="gmail_quote">2013/7/10 Alexander Kjeldaas <span dir="ltr">&lt;<a href="mailto:alexander.kjeldaas@gmail.com" target="_blank">alexander.kjeldaas@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div dir="ltr"><div><div>Here are some common-lisp web frameworks using continuations:<br><br><a href="http://common-lisp.net/project/cl-weblocks/" target="_blank">http://common-lisp.net/project/cl-weblocks/</a><br><a href="http://common-lisp.net/project/ucw/features.html" target="_blank">http://common-lisp.net/project/ucw/features.html</a><br>



<br></div>What always worried me with these frameworks is how they could be made robust in case of failures.  Storing all state in a database backend often makes it possible to isolate failures.  However, it seems to me that it is be possible to solve this in Haskell where state can be serialized and synchronized between multiple machines using Cloud Haskell, something that is error-prone or impossible in other languages.  But that step has never been taken.<span class="HOEnZb"><font color="#888888"><br>



<br></font></span></div><span class="HOEnZb"><font color="#888888">Alexander<br></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jul 10, 2013 at 4:48 PM, Alberto G. Corona <span dir="ltr">&lt;<a href="mailto:agocorona@gmail.com" target="_blank">agocorona@gmail.com</a>&gt;</span> wrote:<br>



<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid"><div dir="ltr"><div>Thanks Adrian. The racket people where pioneers in this idea I think. </div>

<div> </div><div>There is another web framework in Ocaml, Osigen that it is also continuation based. MFlow is not continuation-based but it also define the navigation as a sequence. But only Seaside (and now MFlow) supports many flows in the same page. See for example this: </div>





<div> </div><div>[PDF] <a href="http://www.google.es/url?sa=t&amp;rct=j&amp;q=&amp;esrc=s&amp;frm=1&amp;source=web&amp;cd=3&amp;cad=rja&amp;ved=0CEwQFjAC&amp;url=http%3A%2F%2Fscg.unibe.ch%2Farchive%2Fpapers%2FDuca04eSeaside.pdf&amp;ei=WnPdUYHPI-Ly7Aaa0oHQDA&amp;usg=AFQjCNFxwsFQc9QsQCNPRFfD4t6ReQtP5g&amp;sig2=_klwtzxIKW5UzAOUDOvFCw" target="_blank"><font color="#1122cc"><strong>Seaside</strong> – A <strong>Multiple</strong> Control <strong>Flow</strong> Web Application Framework</font></a></div>





<div> </div><div>There is also other: Apache Coccoon that run in a special kind of JavaScript. The continuation-based frameworks have the reputation of storing a lot of application state and to be non  scalable. MFlow uses backtracking and It does not have these problems.</div>





</div><div class="gmail_extra"><div><div><br><br><div class="gmail_quote">2013/7/10 Adrian May <span dir="ltr">&lt;<a href="mailto:adrian.alexander.may@gmail.com" target="_blank">adrian.alexander.may@gmail.com</a>&gt;</span><br>



<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid">

<div dir="ltr"><div><div><div><div>Oh how nice!<br><br></div>I have been looking at MFlow a lot lately and I think it&#39;s got something quite special that Yesod, Happstack, etc don&#39;t seem to have, at least, not as far as I know. I mean, look at this:<br>






<br><pre><div><span>sumWidget</span><span>=</span> <span>pageFlow</span> <span>&quot;sum&quot;</span> <span>$</span> <span>do</span></div><div>
      <span>n1</span> <span>&lt;-</span> <span>p</span> <span>&lt;&lt;</span> <span>&quot;Enter first number&quot;</span>  <span>++&gt;</span> <span>getInt</span> <span>Nothing</span> <span>&lt;**</span> <span>submitButton</span> <span>&quot;enter&quot;</span> <span>&lt;++</span> <span>br</span></div>






<div>      <span>n2</span> <span>&lt;-</span> <span>p</span> <span>&lt;&lt;</span> <span>&quot;Enter second number&quot;</span> <span>++&gt;</span> <span>getInt</span> <span>Nothing</span> <span>&lt;**</span> <span>submitButton</span> <span>&quot;enter&quot;</span> <span>&lt;++</span> <span>br</span></div>






<div>      <span>n3</span> <span>&lt;-</span> <span>p</span> <span>&lt;&lt;</span> <span>&quot;Enter third number&quot;</span>  <span>++&gt;</span> <span>getInt</span> <span>Nothing</span> <span>&lt;**</span> <span>submitButton</span> <span>&quot;enter&quot;</span> <span>&lt;++</span> <span>br</span></div>






<div>      <span>p</span> <span>&lt;&lt;</span>  <span>(</span><span>&quot;The result is: &quot;</span><span>++</span><span>show</span> <span>(</span><span>n1</span> <span>+</span> <span>n2</span> <span>+</span> <span>n3</span><span>))</span>  <span>++&gt;</span>  <span>wlink</span> <span>()</span> <span>&lt;&lt;</span> <span>b</span> <span>&lt;&lt;</span> <span>&quot; menu&quot;</span></div>






<div>      <span>&lt;++</span> <span>p</span> <span>&lt;&lt;</span> <span>&quot;you can change the numbers in the boxes to see how the result changes&quot;</span></div>
<div><br></div></pre>Is that pretty or what? That&#39;s the code for this:<br><br><a href="http://mflowdemo.herokuapp.com/noscript/fviewmonad" target="_blank">http://mflowdemo.herokuapp.com/noscript/fviewmonad</a><br>
<br></div>To me that&#39;s a real technological step over and above the usual servlets paradigm and I&#39;d love to see more people getting involved. It seems like Yesod and Happstack have a lot more manpower behind them, but unless I&#39;ve missed something, MFlow is going somewhere new and should be helped along. <br>






 <br></div>Adrian.<br><br></div>PS. Besides Seaside, Racket is playing with the same ideas. They (Jay McCarthy) have something to say about performance but I didn&#39;t quite understand it.<br><br></div><div class="gmail_extra">






<br><br><div class="gmail_quote"><div><div>On 10 July 2013 06:41, Alberto G. Corona <span dir="ltr">&lt;<a href="mailto:agocorona@gmail.com" target="_blank">agocorona@gmail.com</a>&gt;</span> wrote:<br></div></div>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid"><div><div>
<div dir="ltr"><div>The third version of MFlow is out.</div><div> </div><div><a href="http://hackage.haskell.org/package/MFlow" target="_blank">http://hackage.haskell.org/package/MFlow</a></div><div> </div><div>MFlow is an all-heterodox web application framework, but very haskellish. </div>








<div> </div><div>Now MFlow support restful URLs.  It is the first stateful web framework to my knowledge that supports it. The type safe routes are implicitly expressed as normal monadic code within a navigation monad. The application look as a normal imperative console application, but the navigation monad goes back and forth to match the path of the URL. The user has control of the state, that can roll-back or not when the navigation goes back depending on the application needs. The state is in the form of normal Haskell variables In a monadic computation, with the weird addition of backtracking.</div>








<div> </div><div>The menu of the application below is implemented as an imperative-like syntax, but the application navigate forward and backward to synchronize with the requests of the web browser:</div><div><a href="http://mflowdemo.herokuapp.com/" target="_blank">http://mflowdemo.herokuapp.com/</a></div>








<div> </div><div>This version support  in-page flows.</div><div> What is that? look at this example:</div><div> </div><div><a href="http://mflowdemo.herokuapp.com/noscript/fviewmonad" target="_blank">http://mflowdemo.herokuapp.com/noscript/fviewmonad</a></div>








<div> </div><div>These flows are implemented as formlets with a monad instance, and callbacks which change the look. I call them &quot;widgets&quot;:</div><div> </div><div><a href="http://haskell-web.blogspot.com.es/2013/06/the-promising-land-of-monadic-formlets.html" target="_blank">http://haskell-web.blogspot.com.es/2013/06/the-promising-land-of-monadic-formlets.html</a></div>








<div> </div><div> </div><div>Each page may have many  of these active widgets, each one running their own flow. These widgets refresh themselves trough Ajax if they are enclosed in the primitive &quot;autoRefresh&quot;. If there is no Ajax or JavaScript available, they gracefully degrade by refreshing the entire page:</div>








<div> </div><div><a href="http://mflowdemo.herokuapp.com/noscript/combination" target="_blank">http://mflowdemo.herokuapp.com/noscript/combination</a></div><div> </div><div><a href="http://haskell-web.blogspot.com.es/2013/06/and-finally-widget-auto-refreshing.html" target="_blank">http://haskell-web.blogspot.com.es/2013/06/and-finally-widget-auto-refreshing.html</a></div>








<div> </div><div>The page flows and the multiflow idea was inspired in <a href="http://www.seaside.st/" target="_blank">Seaside</a>, a great Smalltalk web framework and adapted to the pure recursive nature of Haskell and the formlets.</div>








<div> </div><div>It also support some JQuery widgets integrated: modal and not modal dialogs, datePicker and other active widgets that handle other widgets.</div><div> </div><div>It also support the older features: persistent state, WAI, blaze-html and others integration, server process timeouts, Ajax, requirements, </div>








<div> content management, caching of widget rendering and all the other previous stuff.</div><div> </div><div>I wish to thank some people for their feedback. Specially Adrian May for his feedback and interest</div><span><font color="#888888"><p>






<br>

-- <br>Alberto.
</p></font></span></div>
<br></div></div>_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
<br></blockquote></div><br></div>
<br>_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
<br></blockquote></div><br><br clear="all"><br></div></div><span><font color="#888888">-- <br>Alberto.
</font></span></div>
<br>_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
<br></blockquote></div><br></div>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Alberto.
</div>