[Haskell-cafe] Re: Getting my feet wet - not in Haskell though
Tomasz Zielonka
tomasz.zielonka at gmail.com
Sat Dec 23 17:32:09 EST 2006
On Fri, Dec 22, 2006 at 06:16:03PM +0100, Joachim Durchholz wrote:
> * Forcing the expressions that get written out means that I cannot use
> lazy evaluation freely. In particular, if some library code returns a
> data structure that contains a lazy-infinite subexpression, serializing
> it would not terminate, and I'd have little chance of fixing that.
I fear that you may not have a good intuition about laziness and how it
is used in practical programming at this moment. Why not try and see if
there really is a problem?
> Now that the first serialization will destroy many of the advantages of
> laziness, I don't think I should try to wrestle with its disadvantages.
A common problem with laziness is the possibility of introducing space
leaks. That's when the program accumulates a big thunk which, if forced,
would reduce to a small and simple value. "Nobody" is interested in this
value now, so it is kept in a lazy, space inefficient form. A classic
example is a thunk like this (1+1+1+1+1+1+...)
One solution to this problem is "deepSeq" - forcing full evaluation of a
data structure. Naive serialisation performs this as a side-effect.
What I want to tell is that the "problem" you see here could just as well
be a *solution* to a different problem that you haven't considered yet -
space leaks!
> I'll move on to the alternatives - Alice ML and/or Clean. Both can
> serialize without forcing lazy subexpressions.
I am pretty sure that with those solutions you will meet other problems
of the same caliber. What I propose is the following: keep Haskell as a
possibility (with one discovered problem), consider problems with those
other languages, then decide.
There doesn't seem to be a perfect programming language.
> This all said, I still don't think that Haskell or its execution
> environments are bad. They just don't fit my requirements, which are
> A) I want to get my feet wet with an FPL (seriously, this time), and
> B) I want to do a webserver application (I know the domain).
Haskell would play well with those requirements. I've created some web
applications in it, and I was delighted with the things I learned in the
process.
I am starting to suspect that you have a third requirement you haven't
told us about, like: C) I want to make profit ;-)
Best regards
Tomasz
More information about the Haskell-Cafe
mailing list