Re: Re[2]: returning to cost of Integer

2006-08-02 Thread Neil Mitchell
Hi (i know about Haskell standard, but how many programs relies on 32-bit Ints?) The standard demands the range [-2^29 .. 2^29 - 1] You don't have a problem, some were reserved for you already. Thanks Neil ___ Glasgow-haskell-users mailing list Gl

Re: returning to cost of Integer

2006-08-02 Thread John Meacham
On Thu, Aug 03, 2006 at 02:12:15AM +0400, Bulat Ziganshin wrote: > the main condition is to use some special Int30# type instead of Int# > (which we got used to be 32 bits long). i.e. for the type [Char}, > where Char= C# Int30# it will be ok, but for [Int] it will be bad > (i know about Haskell st

Re[2]: returning to cost of Integer

2006-08-02 Thread Bulat Ziganshin
Hello John, Thursday, August 3, 2006, 1:25:45 AM, you wrote: >> evaluated. If the contents of the constructor itself can be packed into >> the other 30 bits, then there's no need for a pointer at all. For >> enumerated types, you can use all 31 bits for the tag, since only 1 bit is >> require

Re: returning to cost of Integer

2006-08-02 Thread John Meacham
On Wed, Aug 02, 2006 at 01:06:48PM +0100, Simon Marlow wrote: > I like this idea - I remember discussing just such a scheme with John > Launchbury recently. It has a lot in common with the semi-tagging scheme > we've wanted to implement for some time, where the idea is that you use the > low bi

Re: Replacement for GMP

2006-08-02 Thread Esa Ilari Vuokko
On 8/3/06, John Meacham <[EMAIL PROTECTED]> wrote: On Wed, Aug 02, 2006 at 03:22:57PM -0400, Peter Tanski wrote: > Esa and I had discussed the possibility of copying the value returned > from the Bignum lib into the GHC system, which certainly would not be > very memory efficient, but might be fa

Re: Replacement for GMP

2006-08-02 Thread John Meacham
On Wed, Aug 02, 2006 at 03:22:57PM -0400, Peter Tanski wrote: > >I suppose that one alternative is to let the library use 'malloc', but > >make a foreign-pointer proxy for every bignum, which calls 'free' when > >the GHC garbage collector frees it. Not as efficient, though. > > Esa and I had disc

Re: Re[4]: Replacement for GMP

2006-08-02 Thread Peter Tanski
Hi Bulat, the same binary that also wants to use GMP. (Of course, we could *copy* GMP, changing all the function names. That would eliminate the problem!) isn't it rather easy task for some automated tool? i think that even existing tools may be found I know copyrights are weak compared t

Re[4]: Replacement for GMP

2006-08-02 Thread Bulat Ziganshin
Hello Peter, Wednesday, August 2, 2006, 10:37:23 PM, you wrote: >>> the same binary that also wants to use GMP. (Of course, we could >>> *copy* >>> GMP, changing all the function names. That would eliminate the >>> problem!) >> >> isn't it rather easy task for some automated tool? i think that

Re: Replacement for GMP

2006-08-02 Thread Peter Tanski
Simon, (1) We'd be delighted to use a BSD-licensed alternative to GMP in GHC. It's been a long-standing issue, just never quite important enough to get done. If either or both of you are willing to put in the legwork, and emerge with an implementation that we understand and can maintain, we'd b

Re: Re[2]: Replacement for GMP

2006-08-02 Thread Peter Tanski
Hi Bulat, don't forget about speed/memory efficiency of any programs that use Integer "just for case" but really most of their numbers fit in 32/64 bits. i have one particular program of this type - it builds list of all files on disk and Integers are used to save filesizes. i will be glad if, v

Re[2]: Replacement for GMP

2006-08-02 Thread Bulat Ziganshin
Hello Simon, Wednesday, August 2, 2006, 4:05:51 PM, you wrote: > (2) We're concerned about performance. Replacing GMP, but losing > substantial performance on bignum-intensive programs would be > unattractive. don't forget about speed/memory efficiency of any programs that use Integer "just for

Re[2]: returning to cost of Integer

2006-08-02 Thread Bulat Ziganshin
Hello Simon, Wednesday, August 2, 2006, 4:06:48 PM, you wrote: >> Actually, you can keep it to one test for add/subtract if you >> use a single word that is either a number or a pointer, the >> pointer being tagged in lowest bit. Then you can add first >> and check for tags after. Having tags i

Re: returning to cost of Integer

2006-08-02 Thread Simon Marlow
Lennart Augustsson wrote: Actually, you can keep it to one test for add/subtract if you use a single word that is either a number or a pointer, the pointer being tagged in lowest bit. Then you can add first and check for tags after. Having tags is rare, so the machine should be told so, if poss

RE: Replacement for GMP

2006-08-02 Thread Simon Peyton-Jones
Esa, Peter Thank you for diving into the GMP stuff. Simon and I discussed it a bit; here's a summary: (1) We'd be delighted to use a BSD-licensed alternative to GMP in GHC. It's been a long-standing issue, just never quite important enough to get done. If either or both of you are willing to pu