strictness of interpreted haskell implementations
josef.svenningsson at gmail.com
Fri Apr 25 17:57:10 EDT 2008
On Fri, Apr 25, 2008 at 9:17 PM, Duncan Coutts
<duncan.coutts at worc.ox.ac.uk> wrote:
> On Fri, 2008-04-25 at 09:08 -0700, Don Stewart wrote:
> > Geraint.Jones:
> > > Are there well-known differences in the implementations of Haskell in
> > > ghci and hugs? I've got some moderately intricate code (simulations
> > > of pipelined processors) that behave differently - apparently because
> > > ghci Haskell is stricter than hugs Haskell, and I cannot find any
> > > obviously relevant claims about strictness in the documentation.
> I think they should give the same answer. It sounds like a bug in one
> implementation or the other.
I suspect this might be a library thing. If ghc and hugs uses
different versions of the library and some function had its strictness
property changed then that might account for the discrepancy.
> > Hugs does no optimisations, while GHC does a truckload, including
> > strictness analysis. Some of these optimisations prevent space leaks.
> Though none should change the static semantics.
That was my initial reaction as well, but then I recalled that some of
ghc's optimizations actually changes the strictness behavior. The
foldr/build transformation for instance can actually change the
strictness of a function such that you can actually observe it. So we
can't rule out that ghc is doing something it shouldn't be doing.
> Post the code. Even if you don't have time to track down the difference,
> someone might.
Yep, without the code we're just fumbling in the dark.
More information about the Glasgow-haskell-users