[Haskell-cafe] Is Haskell a Good Choice for Web Applications? (ANN: Vocabulink)

wren ng thornton wren at freegeek.org
Thu May 7 00:06:10 EDT 2009


FFT wrote:
> Anton van Straaten wrote:
> 
> > The app is written for a client under NDA, so a blog about it would have to
> > be annoyingly vague.
> 
> > No doubt the potential for encountering space leaks goes up as one writes
> > less pure code, persist more things in memory, and depend on more libraries.
> 
> Exactly. I'm worried about, e.g. needing to use something as simple as
> a stream of prime numbers (see the recent thread about leaks there)

The issues here are going to be the same in Haskell as in every other 
language. There's always a tradeoff between the memory of caching old 
results vs the time of recalculating them. At present no language's 
RTS/GC is smart enough to make that tradeoff for you, and so memoization 
must be done manually.

There are some tricks to help make this easier (e.g. weak pointers), but 
the problem will always remain. The only thing that makes this perhaps 
trickier than in other languages is that, AFAIK/R, the reflection API to 
ask the RTS how it's feeling about memory at any given point isn't 
terribly portable (between Haskell compilers) or polished/pretty. Then 
again, the other GC languages I've dealt with aren't much better and are 
often worse.

-- 
Live well,
~wren


More information about the Haskell-Cafe mailing list