Re: [Haskell-cafe] Re: GHC predictability

2008-05-14 Thread Don Stewart
derek.a.elkins: > On Mon, 2008-05-12 at 19:30 -0700, Don Stewart wrote: > > > I offer up the following example: > > > > > > mean xs = sum xs / length xs > > > > > > Now try, say, "mean [1.. 1e9]", and watch GHC eat several GB of RAM. (!!) > > > > But you know why, don't you? > > > > > sat down

Re: [Haskell-cafe] Re: GHC predictability

2008-05-14 Thread Derek Elkins
On Mon, 2008-05-12 at 19:30 -0700, Don Stewart wrote: > > I offer up the following example: > > > > mean xs = sum xs / length xs > > > > Now try, say, "mean [1.. 1e9]", and watch GHC eat several GB of RAM. (!!) > > But you know why, don't you? > > > sat down and spent the best part of a day wri

Re: [Haskell-cafe] Re: GHC predictability

2008-05-14 Thread Brandon S. Allbery KF8NH
On 2008 May 14, at 14:23, Andrew Coppin wrote: Neil Mitchell wrote: 1. What is "ghc-core"? You actually answer this question as part of question 2. Think of it as simple Haskell with some additional bits. I rephrase: I know what GHC's Core language is. But Dons said "I suggest you insta

Re: [Haskell-cafe] Re: GHC predictability

2008-05-14 Thread Andrew Coppin
Richard A. O'Keefe wrote: On 14 May 2008, at 8:58 am, Andrew Coppin wrote: What I'm trying to say [and saying very badly] is that Haskell is an almost terrifyingly subtle language. Name me a useful programming language that isn't. Simply interchanging two for-loops, from for (i = 0; i < N

Re: [Haskell-cafe] Re: GHC predictability

2008-05-14 Thread Andrew Coppin
Neil Mitchell wrote: Hi 1. What is "ghc-core"? You actually answer this question as part of question 2. Think of it as simple Haskell with some additional bits. I rephrase: I know what GHC's Core language is. But Dons said "I suggest you install ghc-core", which suggests the ex

Re: [Haskell-cafe] Re: GHC predictability

2008-05-14 Thread Andrew Coppin
Don Stewart wrote: ndmitchell: 2. Does anybody know how to actually read GHC's Core output anyway? There is one different from standard Haskell I am aware of. In Core, case x of _ -> 1 will evaluate x, in Haskell it won't. Other than that, its just Haskell, but without pattern matchi

Re: [Haskell-cafe] Re: GHC predictability

2008-05-13 Thread Richard A. O'Keefe
On 14 May 2008, at 8:58 am, Andrew Coppin wrote: What I'm trying to say [and saying very badly] is that Haskell is an almost terrifyingly subtle language. Name me a useful programming language that isn't. Simply interchanging two for-loops, from for (i = 0; i < N; i++) for (j = 0; j <

Re: [Haskell-cafe] Re: GHC predictability

2008-05-13 Thread Albert Y. C. Lai
Andrew Coppin wrote: 2. Does anybody know how to actually read GHC's Core output anyway? To me, it looks almost exactly like very, very complicated Haskell source with a suspicious concentration of case expressions - but I understand that in the Core language, many constructs actually mean some

Re: [Haskell-cafe] Re: GHC predictability

2008-05-13 Thread Don Stewart
ndmitchell: > Hi > > > 1. What is "ghc-core"? > > You actually answer this question as part of question 2. Think of it > as simple Haskell with some additional bits. > > > 2. Does anybody know how to actually read GHC's Core output anyway? > > To me, > > it looks almost exactly like very, very

Re: [Haskell-cafe] Re: GHC predictability

2008-05-13 Thread Neil Mitchell
Hi > 1. What is "ghc-core"? You actually answer this question as part of question 2. Think of it as simple Haskell with some additional bits. > 2. Does anybody know how to actually read GHC's Core output anyway? > To me, > it looks almost exactly like very, very complicated Haskell source with

[Haskell-cafe] Re: GHC predictability

2008-05-13 Thread Achim Schneider
Andrew Coppin <[EMAIL PROTECTED]> wrote: > You're probably right about all that. I would humbly suggest that > what is somewhat lacking is a good, introductory, high-level text on > what makes Haskell go fast and what makes it go slow. As with many > things in the Haskell world, there are bits and

[Haskell-cafe] Re: GHC predictability

2008-05-13 Thread Andrew Coppin
Don Stewart wrote: Now try, say, "mean [1.. 1e9]", and watch GHC eat several GB of RAM. (!!) But you know why, don't you? What I'm trying to say [and saying very badly] is that Haskell is an almost terrifyingly subtle language. Seemingly insignificant chages can have drastic consequ

Re: [Haskell-cafe] Re: GHC predictability

2008-05-13 Thread Anton van Straaten
Achim Schneider wrote: To get a bit more on-topic: I currently completely fail to implement a layout rule in Parsec because I don't understand its inner workings, and thus constantly mess up my state. Parsec's ease of usage is deceiving as soon as you use more than combinators: Suddenly the plumb

[Haskell-cafe] Re: GHC predictability

2008-05-13 Thread Achim Schneider
"Darrin Thompson" <[EMAIL PROTECTED]> wrote: > On Tue, May 13, 2008 at 2:20 AM, Don Stewart <[EMAIL PROTECTED]> wrote: > > Note the use of strict pairs. Key to ensuring the accumulators > > end up in registers.The performance difference here is due to > > fold (and all left folds) not fusing

[Haskell-cafe] Re: GHC predictability

2008-05-13 Thread Don Stewart
> I offer up the following example: > > mean xs = sum xs / length xs > > Now try, say, "mean [1.. 1e9]", and watch GHC eat several GB of RAM. (!!) But you know why, don't you? > sat down and spent the best part of a day writing an MD5 > implementation. Eventually I got it so that all the test