[Haskell-cafe] Can this be done?

Cristiano Paris cristiano.paris at gmail.com
Wed Feb 11 10:36:42 EST 2009

On Wed, Feb 11, 2009 at 4:08 PM, Manlio Perillo
<manlio_perillo at libero.it> wrote:
> Cristiano Paris ha scritto:
>> On Wed, Feb 11, 2009 at 2:30 PM, Peter Verswyvelen <bugfact at gmail.com>
>> wrote:
>>> I haven't looked at the details, but I think this is what a library like
>>> Reactive from Conal Elliott could do, but as far as I understand it, it
>>> is
>>> still work in progress.
>> I'm interested in the possibility of
>> stopping/pickling/unpickling/resuming a computation.
> Not sure this is a good thing in a web application.

I'm thinking of complex workflows and inversion of control.

A computation may stop, return a response, wait for a new request to
be passed by the HTTP server and return back a new response, stopping
again. This goes on forever. All this can be achieved in Haskell but
the serialization path, which is crucial for swapping out idle
sessions (containing the stopped computation) or to get back to life
after server stopped (for maintenance for instance). I guess this
should be doable in Clean, which has mechanisms to do dynamic binding
and serialization of closures.

I once did something close to this using Stackless Python, which
sports serializable iterators. I did funny things like moving all the
sessions to a different server transparently. Nevertheless, the use of
yield, specially in sub-computation, is tricky to handle.

Notice that this is not a main concern in my daily work but the
possibility fascinates me and it turns out to be not a simple problem
to solve. During my explorations, I considered continuations,
delimited continuations and zippers, and I learned a lot even if I
can't still catch delimited continuations.

Recently, I stumbled upon Factor and realized that most of the
complications are simply cut out in that language as it is purely
concatenative (no symbol bindings to mess around).


More information about the Haskell-Cafe mailing list