Re: [Haskell-cafe] Strictness leak

2007-10-31 Thread Ketil Malde
Jeff Polakow [EMAIL PROTECTED] writes: Besides anything else, sequence will diverge on an infinite list. Argh, of course. Thanks! It is necessary to compute all of the computations in the list before returning any of the pure resulting list. Replacing sequence with sequence', given as:

[Haskell-cafe] Embedding the GHC API

2007-10-31 Thread Joel Reymont
Has anyone tried to embed GHC as a library recently? What is the size of the resulting binary? I'm assuming a bare minimum of needed libraries. Thanks, Joel -- http://wagerlabs.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Embedding the GHC API

2007-10-31 Thread pepe
Austin Seipp has written about this in his blog: http://austin.youareinferior.net/?q=node/29 I will take this time to point out that using the GHC API in your applications results in *large* executables. The Interact example above when compiled with vanilla --make options resulted in a

[Haskell-cafe] Why can't Haskell be faster?

2007-10-31 Thread Paulo J. Matos
Hello all, I, along with some friends, have been looking to Haskell lately. I'm very happy with Haskell as a language, however, a friend sent me the link: http://shootout.alioth.debian.org/gp4/ which enables you compare several language implementations. Haskell seems to lag behind of Clean. From

[Haskell-cafe] Re[2]: [Haskell] Image manipulation

2007-10-31 Thread Bulat Ziganshin
Hello Bjorn, Wednesday, October 31, 2007, 11:54:33 AM, you wrote: data fields. Data Field Haskell had a function to force the evaluation of all elements in a data field at once. this looks like a parallel arrays? -- Best regards, Bulatmailto:[EMAIL PROTECTED]

Re: [Haskell-cafe] Why can't Haskell be faster?

2007-10-31 Thread manu
From what I've seen of Clean it seems almost like Haskell. It even distributes a Haskell-Clean translator so the obvious question is, why is Haskell slower? It's also something I've wondered about, and I'm curious about the answer... One of the differences between Haskell and Clean is

Re: [Haskell-cafe] Why can't Haskell be faster?

2007-10-31 Thread Adrian Hey
Paulo J. Matos wrote: Hello all, I, along with some friends, have been looking to Haskell lately. I'm very happy with Haskell as a language, however, a friend sent me the link: http://shootout.alioth.debian.org/gp4/ which enables you compare several language implementations. Haskell seems to

[Haskell-cafe] Re: Why can't Haskell be faster?

2007-10-31 Thread Peter Hercek
I'm curious what experts think too. So far I just guess it is because of clean type system getting better hints for optimizations: * it is easy to mark stuff strict (even in function signatures etc), so it is possible to save on unnecessary CAF creations * uniqueness types allow to do

[Haskell-cafe] Re: Why can't Haskell be faster?

2007-10-31 Thread Peter Hercek
Add to that better unbox / box annotations, this may make even bigger difference than the strictness stuff because it allows you to avoid a lot of indirect references do data. Anyway, if Haskell would do some kind of whole program analyzes and transformations it probably can mitigate all the

Re: [Haskell-cafe] Re: Why can't Haskell be faster?

2007-10-31 Thread Dougal Stanton
On 31/10/2007, Peter Hercek [EMAIL PROTECTED] wrote: Anyway, if Haskell would do some kind of whole program analyzes and transformations it probably can mitigate all the problems to a certain degree. I think JHC is supposed to do whole-program optimisations. Rumour has it that its Hello

Re: [Haskell-cafe] help needed packaging curl bindings

2007-10-31 Thread Ian Lynagh
Hi Brad, On Tue, Oct 30, 2007 at 10:10:17PM -0700, brad clawsie wrote: i have decided to take on the task of packaging-up (for hackage) and documenting the curl bindings as available here: http://code.haskell.org/curl/ if the originators of this code are reading this and do not wish me

Re: [Haskell-cafe] Re: Why can't Haskell be faster?

2007-10-31 Thread Paulo J. Matos
On 31/10/2007, Peter Hercek [EMAIL PROTECTED] wrote: Add to that better unbox / box annotations, this may make even bigger difference than the strictness stuff because it allows you to avoid a lot of indirect references do data. Anyway, if Haskell would do some kind of whole program

Re: [Haskell-cafe] Re: Why can't Haskell be faster?

2007-10-31 Thread Reinier Lamers
Paulo J. Matos wrote: So the slowness of Haskell (compared to Clean) is consequence of its type system. OK, I'll stop, I did not write Clean nor Haskell optimizers or stuff like that :-D type system? Why is that? Shouldn't type system in fact speed up the generated code, since it will

Re: [Haskell-cafe] Re: Why can't Haskell be faster?

2007-10-31 Thread Jules Bean
Paulo J. Matos wrote: type system? Why is that? Shouldn't type system in fact speed up the generated code, since it will know all types at compile time? The *existence* of a type system is helpful to the compiler. Peter was referring to the differences between haskell and clean.

Re: [Haskell-cafe] Re: Why can't Haskell be faster?

2007-10-31 Thread Robin Green
On Wed, 31 Oct 2007 14:17:13 + Jules Bean [EMAIL PROTECTED] wrote: Specifically, clean's uniqueness types allow for a certain kind of zero-copy mutation optimisation which is much harder for a haskell compiler to automatically infer. It's not clear to me that it's actually worth it, but

Re: [Haskell-cafe] Re: Why can't Haskell be faster?

2007-10-31 Thread Jules Bean
Robin Green wrote: On Wed, 31 Oct 2007 14:17:13 + Jules Bean [EMAIL PROTECTED] wrote: Specifically, clean's uniqueness types allow for a certain kind of zero-copy mutation optimisation which is much harder for a haskell compiler to automatically infer. It's not clear to me that it's

[Haskell-cafe] Re: Why can't Haskell be faster?

2007-10-31 Thread Jeff . Harper
Peter Hercek wrote: * it is easy to mark stuff strict (even in function signatures etc), so it is possible to save on unnecessary CAF creations Also, the Clean compiler has a strictness analyzer. The compiler will analyze code and find many (but not all) cases where a function argument can

Re: [Haskell-cafe] help needed packaging curl bindings

2007-10-31 Thread brad clawsie
On Wed, Oct 31, 2007 at 01:36:40PM +, Ian Lynagh wrote: otherwise i was wondering if people had good examples to point me to for providing the cross-platform support needed for a FFI-based module such as this. i have made the necessary changes to compile the code on freebsd, but for

Re: [Haskell-cafe] binary operator modifiers

2007-10-31 Thread Brent Yorgey
On 10/29/07, Tim Newsham [EMAIL PROTECTED] wrote: I would love to have the ability to define binary operator modifiers. For example: f \overline{op} g = liftM2 op f g f \overleftarrow{op} n = liftM2 op f (return n) n \overrightarrow{op} g = liftM2 op (return n) f

Re: [Haskell-cafe] Re: Why can't Haskell be faster?

2007-10-31 Thread Neil Mitchell
Hi I've been working on optimising Haskell for a little while (http://www-users.cs.york.ac.uk/~ndm/supero/), so here are my thoughts on this. The Clean and Haskell languages both reduce to pretty much the same Core language, with pretty much the same type system, once you get down to it - so I

Re: [Haskell-cafe] Re: Why can't Haskell be faster?

2007-10-31 Thread Don Stewart
ndmitchell: Hi I've been working on optimising Haskell for a little while (http://www-users.cs.york.ac.uk/~ndm/supero/), so here are my thoughts on this. The Clean and Haskell languages both reduce to pretty much the same Core language, with pretty much the same type system, once you get

Re: [Haskell-cafe] Type inference problem with division (/)

2007-10-31 Thread Tim Chevalier
On 10/30/07, Felipe Lessa [EMAIL PROTECTED] wrote: On 10/30/07, Tim Chevalier [EMAIL PROTECTED] wrote: ppos = pi/len2; pi and len2 are both Ints, so dividing them gives you an Int. To convert to a Double, write ppos = fromIntegral (pi/len2). (Type :t fromIntegral in ghci to see what else

Re: [Haskell-cafe] Embedding the GHC API

2007-10-31 Thread Don Stewart
I often use this in my cabal ghc-options: ghc-options: -funbox-strict-fields -O2 -fasm -Wall -optl-Wl,-s the last runs ld's strip automatically. mnislaih: Austin Seipp has written about this in his blog: http://austin.youareinferior.net/?q=node/29 I will take this time to point out

Re: [Haskell-cafe] Re: Why can't Haskell be faster?

2007-10-31 Thread Ryan Dickie
So in a few years time when GHC has matured we can expect performance to be on par with current Clean? So Clean is a good approximation to peak performance? --ryan On 10/31/07, Don Stewart [EMAIL PROTECTED] wrote: ndmitchell: Hi I've been working on optimising Haskell for a little while

Re: [Haskell-cafe] Re: Why can't Haskell be faster?

2007-10-31 Thread Don Stewart
goalieca: So in a few years time when GHC has matured we can expect performance to be on par with current Clean? So Clean is a good approximation to peak performance? The current Clean compiler, for micro benchmarks, seems to be rather good, yes. Any slowdown wrt. the same program

Re: [Haskell-cafe] binary operator modifiers

2007-10-31 Thread Tim Newsham
liftM2 (/) sum length. Anyway, the closest you can get in Haskell is something like this, using the infix expressions of Ken Shan and Dylan Thurstonhttp://www.haskell.org/pipermail/haskell-cafe/2002-July/003215.html : [] It works (?), but it's pretty ugly and hardly seems worth it,

Re: [Haskell-cafe] Re: Why can't Haskell be faster?

2007-10-31 Thread Sebastian Sylvan
On 31/10/2007, Don Stewart [EMAIL PROTECTED] wrote: goalieca: So in a few years time when GHC has matured we can expect performance to be on par with current Clean? So Clean is a good approximation to peak performance? The current Clean compiler, for micro benchmarks, seems to

Re: [Haskell-cafe] help needed packaging curl bindings

2007-10-31 Thread Ian Lynagh
On Wed, Oct 31, 2007 at 08:35:42AM -0700, brad clawsie wrote: On Wed, Oct 31, 2007 at 01:36:40PM +, Ian Lynagh wrote: otherwise i was wondering if people had good examples to point me to for providing the cross-platform support needed for a FFI-based module such as this. i have made

Re: [Haskell-cafe] does the order of splice definitions matter in template haskell, or is this a bug?

2007-10-31 Thread Ian Lynagh
Hi Thomas, On Wed, Oct 31, 2007 at 03:27:20PM -0400, Thomas Hartman wrote: I have a situation where ... stuff... $(expose ['setState, 'getState] f = SetState compiles but f = SetState $(expose ['setState, 'getState] doesn't compile, with error: Not in scope: data constructor

Re: [Haskell-cafe] Re: Why can't Haskell be faster?

2007-10-31 Thread Neil Mitchell
Hi So in a few years time when GHC has matured we can expect performance to be on par with current Clean? So Clean is a good approximation to peak performance? No. The performance of many real world programs could be twice as fast at least, I'm relatively sure. Clean is a good short term

[Haskell-cafe] does the order of splice definitions matter in template haskell, or is this a bug?

2007-10-31 Thread Thomas Hartman
I have a situation where ... stuff... $(expose ['setState, 'getState] f = SetState compiles but f = SetState $(expose ['setState, 'getState] doesn't compile, with error: Not in scope: data constructor 'SetState. Is this a bug? expose is defined in HAppS.State.EventTH t,. --- This e-mail

Re: [Haskell-cafe] Re: Why can't Haskell be faster?

2007-10-31 Thread Dan Piponi
On 10/31/07, Neil Mitchell [EMAIL PROTECTED] wrote: in the long run Haskell should be aiming for equivalence with highly optimised C. Really, that's not very ambitious. Haskell should be setting its sights higher. :-) When I first started reading about Haskell I misunderstood what currying was

[Haskell-cafe] Re: does the order of splice definitions matter in template haskell, or is this a bug?

2007-10-31 Thread Alex Jacobson
order matters. But I hope people are transitioning to using mkCommand instead of expose as it provides more functionality. -Alex- Thomas Hartman wrote: I have a situation where ... stuff... $(expose ['setState, 'getState] f = SetState compiles but f = SetState $(expose ['setState,

Re: [Haskell-cafe] Why can't Haskell be faster?

2007-10-31 Thread Don Stewart
bf3: Are these benchmarks still up-to-date? When I started learning FP, I had to choose between Haskell and Clean, so I made a couple of little programs in both. GHC 6.6.1 with -O was faster in most cases, sometimes a lot faster... I don't have the source code anymore, but it was based on

Re: [Haskell-cafe] Type inference problem with division (/)

2007-10-31 Thread Henning Thielemann
On Tue, 30 Oct 2007, noa wrote: I have the following function: theRemainder :: [String] - [String] - Double theRemainder xs xt = sum( map additional (unique xs) ) where additional x = poccur * (inf [ppos,pneg]) --inf takes [Double] where xsxt = zip

Re: [Haskell-cafe] Why can't Haskell be faster?

2007-10-31 Thread Peter Verswyvelen
Are these benchmarks still up-to-date? When I started learning FP, I had to choose between Haskell and Clean, so I made a couple of little programs in both. GHC 6.6.1 with -O was faster in most cases, sometimes a lot faster... I don't have the source code anymore, but it was based on the book

Re: [Haskell-cafe] Re: Why can't Haskell be faster?

2007-10-31 Thread Henning Thielemann
On Wed, 31 Oct 2007, Dan Piponi wrote: But every day, while coding at work (in C++), I see situations where true partial evaluation would give a big performance payoff, and yet there are so few languages that natively support it. Of course it would require part of the compiler to be present

Re: [Haskell-cafe] Re: Why can't Haskell be faster?

2007-10-31 Thread Lennart Augustsson
There are many ways to implement currying. And even with GHC you can get it to do some work given one argument if you write the function the right way. I've used this in some code where it was crucial. But yeah, a code generator at run time is a very cool idea, and one that has been studied, but

[Haskell-cafe] Re: Why can't Haskell be faster?

2007-10-31 Thread david48
I'd like to see Supero and Jhc - compiled examples in the language shootout. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: Why can't Haskell be faster?

2007-10-31 Thread Peter Hercek
The site claims it is quite up to date: about Haskell GHC The Glorious Glasgow Haskell Compilation System, version 6.6 Examples are compiled mostly in the middle of this year and at least -O was used. Each test has a log available. They are good at documenting what they do. Peter. Peter

Re: [Haskell-cafe] Re: Why can't Haskell be faster?

2007-10-31 Thread Derek Elkins
On Wed, 2007-10-31 at 23:44 +0100, Henning Thielemann wrote: On Wed, 31 Oct 2007, Dan Piponi wrote: But every day, while coding at work (in C++), I see situations where true partial evaluation would give a big performance payoff, and yet there are so few languages that natively support

Re: [Haskell-cafe] Re: Why can't Haskell be faster?

2007-10-31 Thread Stefan O'Rear
On Wed, Oct 31, 2007 at 03:37:12PM +, Neil Mitchell wrote: Hi I've been working on optimising Haskell for a little while (http://www-users.cs.york.ac.uk/~ndm/supero/), so here are my thoughts on this. The Clean and Haskell languages both reduce to pretty much the same Core language,

Re: [Haskell-cafe] Re: Why can't Haskell be faster?

2007-10-31 Thread Neil Mitchell
Hi I don't think the register allocater is being rewritten so much as it is being written: From talking to Ben, who rewrote the register allocator over the summer, he said that the new graph based register allocator is pretty good. The thing that is holding it back is the CPS conversion bit,

Re: [Haskell-cafe] Re: Why can't Haskell be faster?

2007-10-31 Thread Stefan O'Rear
On Thu, Nov 01, 2007 at 02:30:17AM +, Neil Mitchell wrote: Hi I don't think the register allocater is being rewritten so much as it is being written: From talking to Ben, who rewrote the register allocator over the summer, he said that the new graph based register allocator is

Re: [Haskell-cafe] Re: Why can't Haskell be faster?

2007-10-31 Thread Bernie Pope
On 01/11/2007, at 2:37 AM, Neil Mitchell wrote: My guess is that the native code generator in Clean beats GHC, which wouldn't be too surprising as GHC is currently rewriting its CPS and Register Allocator to produce better native code. I discussed this with Rinus Plasmeijer (chief designer

Re: [Haskell-cafe] Re: Why can't Haskell be faster?

2007-10-31 Thread ajb
G'day all. Quoting Derek Elkins [EMAIL PROTECTED]: Probably RuntimeCompilation (or something like that and linked from the Knuth-Morris-Pratt implementation on HaWiki) written by Andrew Bromage. I didn't keep a copy, but if someone wants to retrieve it from the Google cache and put it on the