Re: Updates to FFI spec

2002-09-13 Thread Alastair Reid
Alastair: (In the image processing example, images were megabytes and an expression like (x + (y * mask)) would generate 2 intermediate images (several megabytes) while doing just 2 reductions in Haskell.) Marcin: OCaml allows the programmer to specify an approximate amount of foreign

Re: Updates to FFI spec: performGC

2002-09-12 Thread George Russell
Alastair Reid wrote: [snip] Region-based systems have the quite wonderful property that garbage is disposed of promptly - you don't have to wait for the next GC for the memory to be released. Which means that performGC becomes a nullop. [snip] This is not entirely true. Firstly, some

Re: Updates to FFI spec: performGC

2002-09-11 Thread Alastair Reid
Do you want a stronger wording on what kind of garbage collection is to be performed or do we want to keep it deliberately unspecified (ie, leave it to the individual Haskell system)? It'd be nice to say that it has to be a full GC - but I've no idea how to specify that in a non-operational

Re: Updates to FFI spec: performGC

2002-09-11 Thread George Russell
Alastair wrote about performGC (snipped) It'd be nice to say that it has to be a full GC - but I've no idea how to specify that in a non-operational (i.e., implementation dependent) way. I certainly don't think you should constrain implementations to be able to perform a full GC in any sense.

Re: Updates to FFI spec: performGC

2002-09-11 Thread Alastair Reid
Alastair wrote about performGC (snipped) It'd be nice to say that it has to be a full GC - but I've no idea how to specify that in a non-operational (i.e., implementation dependent) way. George Russell [EMAIL PROTECTED] writes: I certainly don't think you should constrain implementations to

Re: Updates to FFI spec: performGC

2002-09-11 Thread Manuel M T Chakravarty
Alastair Reid [EMAIL PROTECTED] wrote, George Russell [EMAIL PROTECTED] writes: Also there are probably hard-real-time GC algorithms (like Baker's treadmill) or algorithms which are close to being hard-real-time (like the train algorithm) where doing a full GC would be a major pain.

Re: Updates to FFI spec: performGC

2002-09-10 Thread Alastair Reid
I think the thing to do is add the existing performGC to the standard (perhaps giving it an hs_ prefix in the process) and leave development of an extended version of the function for when the GHC folk (or anyone else with a generational collector) decide they want a forcefulness argument. Come

Re: Updates to FFI spec: hs_init() friends

2002-09-10 Thread Malcolm Wallace
Alastair Reid [EMAIL PROTECTED] writes: So, my proposal is to: [...] I think only GHC implements anything like this (correct me if wrong, Malcolm) and they haven't used it in the way John Meacham is interested in. At the moment, nhc98 provides a routine void haskellInit (int argc,

RE: Updates to FFI spec

2002-08-13 Thread Simon Marlow
On 12-Aug-2002, Simon Marlow [EMAIL PROTECTED] wrote: I'd be equally happy (perhaps happier) if the header file spec was removed altogether. In a sense, this would leave the Haskell part of a foreign binding even more portable, because it doesn't have to specify the names of

RE: Updates to FFI spec

2002-08-13 Thread Simon Marlow
System.Mem.performGC does a major GC. When would a partial GC be enough? I've described the image-processing example a bunch of times. We have an external resource (e.g., memory used to store images) which is somewhat abundant and cheap but not completely free (e.g., eventually you

Re: Updates to FFI spec

2002-08-13 Thread Alastair Reid
At the moment, there are two kinds of initialisation done for each module: Both ELF and DLLs on Windows provide a way of specifying initializers. Or, easier yet, since the user is already using the hs_init function, you could use that. The way you'd do that in ELF is to define a special

RE: Updates to FFI spec

2002-08-13 Thread Simon Marlow
At the moment, there are two kinds of initialisation done for each module: Both ELF and DLLs on Windows provide a way of specifying initializers. Or, easier yet, since the user is already using the hs_init function, you could use that. The way you'd do that in ELF is to define a

Re: Updates to FFI spec

2002-08-11 Thread Manuel M T Chakravarty
Alastair Reid [EMAIL PROTECTED] wrote, For those not on the cvs mailing list: I've applied all the changes discussed over the last 2 moniths that received some support and no dissent. Changes since RC5: * Author list: changed Alastair Reid's institution * 4.1.1: Removed [lib]

Re: Updates to FFI spec

2002-08-11 Thread Alastair Reid
- I'd like to see a standard way to call the GC from C http://www.mail-archive.com/ffi@haskell.org/msg00565.html Note that Hugs and GHC have had this for ages except that we call the function 'performGC' and there's no way to control how many generations are collected. I don't have a

Updates to FFI spec

2002-08-09 Thread Alastair Reid
For those not on the cvs mailing list: I've applied all the changes discussed over the last 2 moniths that received some support and no dissent. Changes since RC5: * Author list: changed Alastair Reid's institution * 4.1.1: Removed [lib] from impent syntax and discussion * 4.1.3: