Re: [Haskell-cafe] Strange memory consumption problems in something that should be tail-recursive

2007-02-16 Thread Sven Panne
On Tuesday 13 February 2007 22:32, Bernie Pope wrote: Creighton Hogg wrote: [...] So for example in the case of, facTail 1 n' = n' facTail n n' = facTail (n-1) (n*n') The problem with this example is that it will build up an expression of the form: (n1 * n2 * n3 .) [...] This

[Haskell-cafe] Strange memory consumption problems in something that should be tail-recursive

2007-02-13 Thread Jefferson Heard
Hi, I am running the following code against a 210 MB file in an attempt to determine whether I should use alex or whether, since my needs are very performance oriented, I should write a lexer of my own. I thought that everything I'd written here was tail-recursive, but after compiling this

Re: [Haskell-cafe] Strange memory consumption problems in something that should be tail-recursive

2007-02-13 Thread Duncan Coutts
On Tue, 2007-02-13 at 15:27 -0500, Jefferson Heard wrote: Hi, I am running the following code against a 210 MB file in an attempt to determine whether I should use alex or whether, since my needs are very performance oriented, I should write a lexer of my own. I thought that everything I'd

Re: [Haskell-cafe] Strange memory consumption problems in something that should be tail-recursive

2007-02-13 Thread Jefferson Heard
On Tuesday 13 February 2007 15:59, Duncan Coutts wrote: On Tue, 2007-02-13 at 15:27 -0500, Jefferson Heard wrote: Hi, I am running the following code against a 210 MB file in an attempt to determine whether I should use alex or whether, since my needs are very performance oriented, I should

Re: [Haskell-cafe] Strange memory consumption problems in something that should be tail-recursive

2007-02-13 Thread Kirsten Chevalier
On 2/13/07, Jefferson Heard [EMAIL PROTECTED] wrote: Argh, bitten by the scheme bug! Right -- NO tail recursion... So that leaves me with some rather non-intuitive strategies for achieving execution time efficiency. Anyone care to point me in the direction of a document on efficiency in

Re: [Haskell-cafe] Strange memory consumption problems in something that should be tail-recursive

2007-02-13 Thread Brandon S. Allbery KF8NH
On Feb 13, 2007, at 16:07 , Kirsten Chevalier wrote: On 2/13/07, Jefferson Heard [EMAIL PROTECTED] wrote: Argh, bitten by the scheme bug! Right -- NO tail recursion... So that leaves me with some rather non-intuitive strategies for achieving execution time efficiency. Anyone care to

Re: [Haskell-cafe] Strange memory consumption problems in something that should be tail-recursive

2007-02-13 Thread Creighton Hogg
On 2/13/07, Duncan Coutts [EMAIL PROTECTED] wrote: On Tue, 2007-02-13 at 15:27 -0500, Jefferson Heard wrote: Hi, I am running the following code against a 210 MB file in an attempt to determine whether I should use alex or whether, since my needs are very performance oriented, I should write

Re: [Haskell-cafe] Strange memory consumption problems in something that should be tail-recursive

2007-02-13 Thread Bernie Pope
Duncan Coutts wrote: On Tue, 2007-02-13 at 15:27 -0500, Jefferson Heard wrote: Hi, I am running the following code against a 210 MB file in an attempt to determine whether I should use alex or whether, since my needs are very performance oriented, I should write a lexer of my own. I

Re: [Haskell-cafe] Strange memory consumption problems in something that should be tail-recursive

2007-02-13 Thread Seth Gordon
Jefferson Heard wrote: Argh, bitten by the scheme bug! Right -- NO tail recursion... So that leaves me with some rather non-intuitive strategies for achieving execution time efficiency. Anyone care to point me in the direction of a document on efficiency in Haskell? I found this page

Re: [Haskell-cafe] Strange memory consumption problems in something that should be tail-recursive

2007-02-13 Thread Bernie Pope
Creighton Hogg wrote: On 2/13/07, *Duncan Coutts* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: On Tue, 2007-02-13 at 15:27 -0500, Jefferson Heard wrote: Hi, I am running the following code against a 210 MB file in an attempt to determine whether I should use alex or

Re: [Haskell-cafe] Strange memory consumption problems in something that should be tail-recursive

2007-02-13 Thread Creighton Hogg
On 2/13/07, Bernie Pope [EMAIL PROTECTED] wrote: Creighton Hogg wrote: This may be silly of me, but I feel like this is an important point: so you're saying that tail recursion, without strictness, doesn't run in constant space? It is an important point, and a classic space bug (see foldl

Re: [Haskell-cafe] Strange memory consumption problems in something that should be tail-recursive

2007-02-13 Thread Jefferson Heard
Ha! You're right! I didn't think about the laziness aspect of it. Anyway, the non tail-recursive version fixed the problem. Thanks! On Tuesday 13 February 2007 16:32, Bernie Pope wrote: Creighton Hogg wrote: On 2/13/07, *Duncan Coutts* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote:

Re: [Haskell-cafe] Strange memory consumption problems in something that should be tail-recursive

2007-02-13 Thread Donald Bruce Stewart
duncan.coutts: On Tue, 2007-02-13 at 15:27 -0500, Jefferson Heard wrote: Hi, I am running the following code against a 210 MB file in an attempt to determine whether I should use alex or whether, since my needs are very performance oriented, I should write a lexer of my own. I thought

Re: [Haskell-cafe] Strange memory consumption problems in something that should be tail-recursive

2007-02-13 Thread Duncan Coutts
On Tue, 2007-02-13 at 15:12 -0600, Creighton Hogg wrote: On 2/13/07, Duncan Coutts [EMAIL PROTECTED] wrote: On Tue, 2007-02-13 at 15:27 -0500, Jefferson Heard wrote: Hi, I am running the following code against a 210 MB file in an attempt to determine