Re: GHC -O2 and unsafePerformIO

2007-05-03 Thread Simon Marlow
Neil Mitchell wrote: Hi Thanks to dcoutts, I have now come up with an answer. I don't understand why it works now, but not before. I do remember than browsing either Core or STG is not a fun thing to do... p_System_IO_hGetChar h = trace "i am here" $ unsafePerformIO $ getCharIO h {-# NO

Re: GHC -O2 and unsafePerformIO

2007-05-03 Thread Neil Mitchell
Hi Simon, This is clearly a misuse of unsafePerformIO (as I'm sure you're aware). Just out of interest - what's the context? I am writing an optimiser for Yhc, doing whole-program optimisation, with the intention of keeping it fast and high performance. Since writing out Yhc bytecode would ki

Re: Error compiling GHC/Num.lhs

2007-05-03 Thread Bas van Dijk
On 5/2/07, Bertram Felgenhauer <[EMAIL PROTECTED]> wrote: ... I have two patches that should fix this: ... Thanks, I applied base-install-includes.patch. (Cabal-fix-installIncludeFiles.patch was already applied according to darcs.) However, in order to apply the patches I did a new checkout of

RE: Error compiling GHC/Num.lhs

2007-05-03 Thread Simon Peyton-Jones
the base library is in a bit of a sad state. I think I have fixed it. Try pulling (both compiler and libraries) and try again S | -Original Message- | From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On | Behalf Of Bas van Dijk | Sent: 03 May 2007 11:32 | To: Bertram Felgenhauer | Cc:

Pretty printing type annotations

2007-05-03 Thread C.M.Brown
Hi, I was wondering if there was an easy way to pretty print the result of the type checker from GHC. I basically want the format that GHCi spits out, rather than a type annotation with qualified types. I know I can knock up a parser that removes the qualifiers, but I was wondering if there was a

Re: Error compiling GHC/Num.lhs

2007-05-03 Thread Bas van Dijk
On 5/3/07, Simon Peyton-Jones <[EMAIL PROTECTED]> wrote: I think I have fixed it... You did, thanks very much! GHC now builds and install without any errors, jippy! Thanks, Bas van Dijk ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@h

Why do we have stack overflows?

2007-05-03 Thread Adrian Hey
Hello Folks, Just wondering about this. Please understand I'm not asking why programs use a lot of stack sometimes, but specifically why is using a lot of stack (vs. using a lot of heap) generally regarded as "bad". Or at least it seems that way given that ghc run time makes distinction between t

Re: Why do we have stack overflows?

2007-05-03 Thread Duncan Coutts
On Thu, 2007-05-03 at 16:24 +0100, Adrian Hey wrote: > Hello Folks, > > Just wondering about this. Please understand I'm not asking why > programs use a lot of stack sometimes, but specifically why is > using a lot of stack (vs. using a lot of heap) generally regarded > as "bad". Or at least it se

Re: Why do we have stack overflows?

2007-05-03 Thread Adrian Hey
Duncan Coutts wrote: On Thu, 2007-05-03 at 16:24 +0100, Adrian Hey wrote: Hello Folks, Just wondering about this. Please understand I'm not asking why programs use a lot of stack sometimes, but specifically why is using a lot of stack (vs. using a lot of heap) generally regarded as "bad". Or at

Re: Why do we have stack overflows?

2007-05-03 Thread John Meacham
On Thu, May 03, 2007 at 05:40:24PM +0100, Adrian Hey wrote: > Duncan Coutts wrote: > >On Thu, 2007-05-03 at 16:24 +0100, Adrian Hey wrote: > >>Hello Folks, > >> > >>Just wondering about this. Please understand I'm not asking why > >>programs use a lot of stack sometimes, but specifically why is > >

Re: Why do we have stack overflows?

2007-05-03 Thread Brandon Michael Moore
On Thu, May 03, 2007 at 04:59:58PM -0700, John Meacham wrote: > I believe it is because a stack cannot be garbage collected, and must be > traversed as roots for every garbage collection. I don't think there are > any issues with a huge stack per se, but it does not play nice with > garbage collect

Re: Why do we have stack overflows?

2007-05-03 Thread Stefan O'Rear
On Thu, May 03, 2007 at 05:36:45PM -0700, Brandon Michael Moore wrote: > On Thu, May 03, 2007 at 04:59:58PM -0700, John Meacham wrote: > > I believe it is because a stack cannot be garbage collected, and must be > > traversed as roots for every garbage collection. I don't think there are > > any is