Straight-line single assignment in C--

2012-01-20 Thread Edward Z. Yang
Hello all, I was wondering if the following style of register assignment ever shows up in C-- code generated by GHC: a = R1 I32[a] = 1 a = R2 I32[a] = 2 That is to say, there are two disjoint live ranges of a: we could rename all instances of a in the first and second lines to so

Re: Runtime performance degradation for multi-threaded C FFI callback

2012-01-20 Thread Edward Z. Yang
Hello Sanket, What happens if you run this experiment with 5 threads in the C function, and have GHC run RTS with -N7? (e.g. five C threads + seven GHC threads = 12 threads on your 12-core box.) Edward Excerpts from Sanket Agrawal's message of Tue Jan 17 23:31:38 -0500 2012: > I posted this issu

Re: named pipes

2012-01-20 Thread Albert Y. C. Lai
On 12-01-19 02:16 PM, Serge D. Mechveliani wrote: -- Main.hs - hPutStr h1 str hFlush h1 This fails to send a newline. --- fifo2.c - if (fgets(str, BOUND,

Re: strange behavior of let in ghci

2012-01-20 Thread Brent Yorgey
On Thu, Jan 19, 2012 at 11:10:09PM -0600, Antoine Latter wrote: > On Thu, Jan 19, 2012 at 10:55 PM, Kazu Yamamoto wrote: > > Hello, > > > > I met strange behavior of let in ghci 7.0.4. The following works well. > > > > You're running into the monomorphism restriction: > http://www.haskell.org/has

Re: Records in Haskell

2012-01-20 Thread Greg Weber
2012/1/18 Simon Peyton-Jones : > | > Has *is* a type class. It can be used and abused like any other. > | > Record members with the same key ought to have the same semantics; the > | > programmer must ensure this, not just call them all "x" or the like. > | > > | > Weak types these are not. The sel

Re: Records in Haskell

2012-01-20 Thread Gábor Lehel
2012/1/18 Simon Peyton-Jones : > | > Has *is* a type class. It can be used and abused like any other. > | > Record members with the same key ought to have the same semantics; the > | > programmer must ensure this, not just call them all "x" or the like. > | > > | > Weak types these are not. The sel

Re: Records in Haskell

2012-01-20 Thread Greg Weber
Thank you Nils for those excellent links. Yitz would like Agda's module/record setup which allows for multiple modules in a single file. Records are yet another local module. The neat thing is, that like any module you can "open" it, or put it into the scope of your current module for convenient u