Re: problem building optimized compiler

2000-03-28 Thread Sven Panne
kirstin reese wrote: (building cvs top with 4.06) When compiling CoreUnfold with the -O flag: ParseIface.hs:6827: Non-exhaustive patterns in case Currently the way to go is: Compile 4.07 with 4.06 *without* -O for hsc. With the resulting 4.07 you can switch -O on again to get an optimized hsc

Re: Bug in pretty printer?

2000-03-28 Thread Michael Marte
On Thu, 9 Dec 1999, Michael Marte wrote: I am using Hugs98 (september release) together with the pretty printer combinators by Hughes and Jones. When printing a large structure, Hugs aborts with the message GC Blackhole. The program works fine for smaller structures. The problem occurs with

Specialization and complicated (?) types

2000-03-28 Thread Carsten Schultz
Hallo everyone, I have a problem concerning the performance of a program and have started suspecting that GHC's optimiser is confused by my types. I have the following modules, types, and functions: module MatrixSparse : data Num a => Vector a = ... data Num a => STMatrix s a = STMat !Int

Re: Additions to the FFI API

2000-03-28 Thread Manuel M. T. Chakravarty
[EMAIL PROTECTED] (Marcin 'Qrczak' Kowalczyk) wrote, Tue, 28 Mar 2000 12:26:34 +1000, Fergus Henderson [EMAIL PROTECTED] pisze: It would be fine to have a `typedef void *HsStablePtr'. But it is important that you do not lose static type information when exporting Haskell functions to C.

Just for fun

2000-03-28 Thread Jerzy Karczmarczuk
If you try to exercize some popular Web search engines on: "Haskell Library" you will get this: http://www.vtonly.com/hstydec9.htm Perhaps we should send them the Report? Jerzy Karczmarczuk Caen, France.

Re: Additions to the FFI API

2000-03-28 Thread Marcin 'Qrczak' Kowalczyk
Tue, 28 Mar 2000 18:25:27 +1000, Manuel M. T. Chakravarty [EMAIL PROTECTED] pisze: One idea that we discussed is that `GtkText*' would map to `Ptr GtkText', where `GtkText' is opaque und would indeed be implemented as newtype GtkText = GtkText () And Ptr is what? "type Ptr a = Addr"

Re: Additions to the FFI API

2000-03-28 Thread Fergus Henderson
On 28-Mar-2000, Marcin 'Qrczak' Kowalczyk [EMAIL PROTECTED] wrote: Tue, 28 Mar 2000 12:26:34 +1000, Fergus Henderson [EMAIL PROTECTED] pisze: It would be fine to have a `typedef void *HsStablePtr'. But it is important that you do not lose static type information when exporting Haskell

Re: Additions to the FFI API

2000-03-28 Thread Fergus Henderson
On 28-Mar-2000, Manuel M. T. Chakravarty [EMAIL PROTECTED] wrote: Sven Panne [EMAIL PROTECTED] wrote, 1) Although the Haskell 98 report states that Char should be a Unicode character, a plain char is used here. No implementation uses Unicode so far, and char is what one wants most of

Re: Additions to the FFI API

2000-03-28 Thread Marcin 'Qrczak' Kowalczyk
Tue, 28 Mar 2000 20:14:26 +1000, Fergus Henderson [EMAIL PROTECTED] pisze: For type constructors like `-', `[]', and `Maybe', which (unlike StablePtr) don't have any C equivalent, I think you probably need to drop the structure, and just keep the top-level type constructor, thus mapping that

Re: Additions to the FFI API

2000-03-28 Thread Fergus Henderson
On 28-Mar-2000, Manuel M. T. Chakravarty [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] (Marcin 'Qrczak' Kowalczyk) wrote, What woyld GtkText* map to? GtkText is a typedef to an opaque struct. One idea that we discussed is that `GtkText*' would map to `Ptr GtkText', where `GtkText' is opaque

Re: Additions to the FFI API

2000-03-28 Thread Fergus Henderson
On 28-Mar-2000, Marcin 'Qrczak' Kowalczyk [EMAIL PROTECTED] wrote: Tue, 28 Mar 2000 20:14:26 +1000, Fergus Henderson [EMAIL PROTECTED] pisze: For type constructors like `-', `[]', and `Maybe', which (unlike StablePtr) don't have any C equivalent, I think you probably need to drop the

Re: Additions to the FFI API

2000-03-28 Thread Qrczak
On Tue, 28 Mar 2000, Fergus Henderson wrote: `struct HsStablePtrSomeUserDefinedTypeConstructor *'. Actually on second thoughts I think that should perhaps be just `struct HsSomeUserDefinedTypeConstructor *' and likewise for all the other mappings from `StablePtr' types;

Re: Additions to the FFI API

2000-03-28 Thread Sven Panne
*sigh* I never thought that the "last words" on this topic would be easy, but on the other hand I never imagined that ISO/ANSI C, POSIX, Unicode, ISO-10646, Ada95, OCaml, persistent functions, etc. will pop up... It's surely worth having a look at things other people have done, but here are some

RE: runtime optimization of haskell

2000-03-28 Thread S. Alexander Jacobson
The issue is not just generating the data for a particular running instance, but rather: 1. generating the data from all/many running instances on user machines 2. sending that data back to the developer for analysis 3. generating useful reports on aggregate data Jacob Nielsen says that data

Re: Additions to the FFI API

2000-03-28 Thread Sven Panne
Julian Assange wrote: Have you looked at the nice (un-)marshaling features of Ocaml? The implementation is such that fist class functions can be marshaled, un-marshaled and subsequently executed, even for natively compiled code. [...] I can't find documentation for the things you mention.

FFI (Ptr a)

2000-03-28 Thread Malcolm Wallace
And Ptr is what? "type Ptr a = Addr" makes "Ptr a" the same as "Ptr b" for any a,b. But newtype Ptr a = Ptr Addr does not allow Ptr a to equal Ptr b. IMHO Haskell should allow newtypes in foreign calls (I'm only not sure if it should require the constructor to be accessible). The

Re: Additions to the FFI API

2000-03-28 Thread Sven Panne
Fergus Henderson wrote: [...] For prior art, see the `Interfaces.C' package in normative Annex E of the Ada 95 standard (available via www.ada.org). My Ada is a little bit rusty, but what I've understood from http://lglwww.epfl.ch/Ada/rm95/rm9x-B-03.html is the following: * Interfaces.C

Re: Random numbers (fwd)

2000-03-28 Thread Michael Marte
-- Forwarded message -- Date: Fri, 24 Mar 2000 15:11:46 + (GMT) From: Deryck F Brown [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: Random numbers Michael, stdGens1 :: [StdGen] stdGens1 = stdGens' seed where stdGens' seed = mkStdGen seed : stdGens'

Re: Additions to the FFI API

2000-03-28 Thread Marcin 'Qrczak' Kowalczyk
Tue, 28 Mar 2000 14:52:56 +0200, Sven Panne [EMAIL PROTECTED] pisze: [...] Strange: I agree in every point! 3) If ISO C has long long (don't know, my copy of Harbison/Steele doesn't mention it), Int64/Word64 should be made mandatory. C99, the recently approved ISO C standard, does have

let vs. case

2000-03-28 Thread Theo Norvell
Hi. I have a data type data Ok_Err s a = Ok s a and a case expression case ok_err' of ~(Ok s' a) - ... which involved in a loop (i.e. the ... contains a tail call back to the function containing the case expression). This takes a lot of space. Specifically the space

Re: Additions to the FFI API

2000-03-28 Thread Marcin 'Qrczak' Kowalczyk
Tue, 28 Mar 2000 14:52:56 +0200, Sven Panne [EMAIL PROTECTED] pisze: 1) To be honest, I don't know enough about char/wchar_t/Unicode/ISO-10646 to make suggestions here. Could somebody more knowledgeable make a proposal how these should be handled in the FFI? Keep in mind that this

Re: Additions to the FFI API

2000-03-28 Thread Manuel M. T. Chakravarty
[EMAIL PROTECTED] (Marcin 'Qrczak' Kowalczyk) wrote, Tue, 28 Mar 2000 18:25:27 +1000, Manuel M. T. Chakravarty [EMAIL PROTECTED] pisze: One idea that we discussed is that `GtkText*' would map to `Ptr GtkText', where `GtkText' is opaque und would indeed be implemented as newtype

Re: Additions to the FFI API

2000-03-28 Thread Manuel M. T. Chakravarty
Fergus Henderson [EMAIL PROTECTED] wrote, On 28-Mar-2000, Manuel M. T. Chakravarty [EMAIL PROTECTED] wrote: Sven Panne [EMAIL PROTECTED] wrote, 1) Although the Haskell 98 report states that Char should be a Unicode character, a plain char is used here. No implementation uses Unicode

Re: runtime optimization of haskell

2000-03-28 Thread Fergus Henderson
On 28-Mar-2000, S. Alexander Jacobson [EMAIL PROTECTED] wrote: The issue is not just generating the data for a particular running instance, but rather: 1. generating the data from all/many running instances on user machines 2. sending that data back to the developer for analysis 3.

Re: Additions to the FFI API

2000-03-28 Thread Manuel M. T. Chakravarty
Fergus Henderson [EMAIL PROTECTED] wrote, On 28-Mar-2000, Manuel M. T. Chakravarty [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] (Marcin 'Qrczak' Kowalczyk) wrote, What woyld GtkText* map to? GtkText is a typedef to an opaque struct. One idea that we discussed is that `GtkText*' would

Re: Additions to the FFI API

2000-03-28 Thread Manuel M. T. Chakravarty
Sven Panne [EMAIL PROTECTED] wrote, Regarding 1. Mapping Haskell types to C types: === 2) It should be *guaranteed* that HsStablePtr and HsAddr are mapped to void* for the reason mentioned by Manuel. Nevertheless,

Re: Additions to the FFI API

2000-03-28 Thread Fergus Henderson
On 28-Mar-2000, Marcin 'Qrczak' Kowalczyk [EMAIL PROTECTED] wrote: Tue, 28 Mar 2000 20:37:24 +1000, Fergus Henderson [EMAIL PROTECTED] pisze: The ANSI/ISO C standard does not guarantee that `wchar_t' will be Unicode, or even that it will be large enough to hold Unicode. I believe that

Re: Additions to the FFI API

2000-03-28 Thread Marcin 'Qrczak' Kowalczyk
Wed, 29 Mar 2000 15:00:46 +1000, Manuel M. T. Chakravarty [EMAIL PROTECTED] pisze: 6) Add HsBool with a mapping to an arbitrary integral C type, see Fergus' point about a Haskell API. (Should we guarantee that False maps to 0 and True to something 0?) We don't make any guarantees