RE: [Haskell-cafe] building Ghc with msvc ?

2005-07-26 Thread Simon Marlow
On 23 July 2005 22:52, Duncan Coutts wrote: On Sat, 2005-07-23 at 22:49 +0200, Jan Scott wrote: Hi, Has anyone ever tried to build Ghc with Microsofts c compiler (msvc) ? GHC relies quite heavily on gcc. GHC's C code backend uses a number of GNU C extensions I believe. I think it

RE: [Haskell-cafe] ForeignPtrs with liveness dependencies

2005-07-26 Thread Simon Marlow
On 25 July 2005 14:44, Einar Karttunen wrote: What is the correct way to express liveness dependencies for ForeignPtrs? I am wrapping a C library and need a way to keep ForeignPtrs alive until the finalizer for an another ForeignPtr has been executed. Basically I have two types, ForeignPtr

RE: [Haskell-cafe] FFI and callbacks

2005-07-26 Thread Simon Marlow
On 25 July 2005 22:41, Sebastian Sylvan wrote: On 7/25/05, Simon Marlow [EMAIL PROTECTED] wrote: On 23 July 2005 03:38, Duncan Coutts wrote: The problem then as John noted is that the main loop of these toolkits block and so the other Haskell threads would not get a chance to schedule. So

Re: [Haskell-cafe] ForeignPtrs with liveness dependencies

2005-07-26 Thread Einar Karttunen
Simon Marlow [EMAIL PROTECTED] writes: You might be able to find more information on this in the mailing list archives. It's true that touchForeignPtr isn't enough to enforce an ordering on the running of finalizers, but it *can* be used to express a liveness relationship between one

RE: [Haskell-cafe] ForeignPtrs with liveness dependencies

2005-07-26 Thread Simon Marlow
On 26 July 2005 11:26, Einar Karttunen wrote: Simon Marlow [EMAIL PROTECTED] writes: You might be able to find more information on this in the mailing list archives. It's true that touchForeignPtr isn't enough to enforce an ordering on the running of finalizers, but it *can* be used to

Re: [Haskell-cafe] FFI and callbacks

2005-07-26 Thread Sebastian Sylvan
On 7/26/05, Simon Marlow [EMAIL PROTECTED] wrote: On 25 July 2005 22:41, Sebastian Sylvan wrote: On 7/25/05, Simon Marlow [EMAIL PROTECTED] wrote: On 23 July 2005 03:38, Duncan Coutts wrote: The problem then as John noted is that the main loop of these toolkits block and so the other

RE: [Haskell-cafe] FFI and callbacks

2005-07-26 Thread Simon Marlow
On 26 July 2005 11:32, Sebastian Sylvan wrote: On 7/26/05, Simon Marlow [EMAIL PROTECTED] wrote: On 25 July 2005 22:41, Sebastian Sylvan wrote: Well how about not touching the bound threads design at all, but modifying the lightweigh threads design to also include forkIOHere (or something)

RE: [Haskell-cafe] ForeignPtrs with liveness dependencies

2005-07-26 Thread Simon Marlow
On 26 July 2005 14:15, Einar Karttunen wrote: Simon Marlow [EMAIL PROTECTED] writes: Now the association becomes associate (Foo _ ref) bar = atomicModifyIORef ref (\lst - (touchForeignPtr bar : lst, ())) Isn't that equivalent to using addForeignPtrFinalizer? I don't think this fixes

[Haskell-cafe] Data-types in dynamically loaded hs-plugins

2005-07-26 Thread Thomas Sutton
Hi all, I'm [trying to] develop a system that uses plug-ins to implement a black-box ADT, that is a data-type and a few typeclass instances for it. I want my system (a theorem prover) to be able to work with any of these plug-ins (which define a logic and operations on its formulae) but

[Haskell-cafe] Newbie question about Read strings in a line of File

2005-07-26 Thread Huong Nguyen
Hello everybody, Now I am writing a module to handles messages of a system. The messages are stored in a file. The content of each line of the file likes this: 1001 001 Error message 1 1001 002 Error message 2 1002

Re: [Haskell-cafe] ForeignPtrs with liveness dependencies

2005-07-26 Thread Einar Karttunen
Simon Marlow [EMAIL PROTECTED] writes: No, unfortunately not. You have foo's finalizer which refers to bar via a touchForeignPtr. If both foo and bar are unreachable (references from finalizers don't count), then both foo and bar's finalizers will be started together, and may run in any

Re: [Haskell-cafe] Newbie question about Read strings in a line of File

2005-07-26 Thread Cale Gibbard
Here's how I wrote it: - beginning of file import IO -- turn a line of the text file into a pair consisting of -- the message triple and the message string -- slight bug: will contract multiple spaces in the message string -- This could be rewritten to avoid this problem, but couldn't make