Re: [Haskell-cafe] Problem with TemplateHaskell

2011-11-02 Thread Magicloud Magiclouds
On Tue, Nov 1, 2011 at 5:42 PM, Magicloud Magiclouds magicloud.magiclo...@gmail.com wrote: Hi,  I have code as following, to make a toDocument function (using Data.Bsin.=:) for a data structure. bson :: DecsQ - DecsQ bson decsq = do  decs - decsq  let datad = head decs      DataD _ _ _

Re: [Haskell-cafe] blog software in Haskell?

2011-11-02 Thread Ketil Malde
Simon Michael si...@joyful.com writes: Did someone mention hakyll already? Yes, Mihai, but thanks for the link. I'll probably check it out when I'm back from vacation. Alistair: I'm already using gitit, but I think it's usage is a bit different. Jason: I know about the various services,

Re: [Haskell-cafe] Hackage feature request: E-mail author when a package breaks

2011-11-02 Thread Max Bolingbroke
On 2 November 2011 01:08, Diego Souza dso...@bitforest.org wrote: The idea is simple: there are many different platforms that would be to expensive for one to support. So they ask the community for help, and then distribute the load amongst the perl community. Duncan and co have been working

Re: [Haskell-cafe] Problem with TemplateHaskell

2011-11-02 Thread Max Bolingbroke
On 2 November 2011 07:42, Magicloud Magiclouds magicloud.magiclo...@gmail.com wrote: How to avoid the name changing? Maybe you should use nameBase rather than show? Max ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Problem with TemplateHaskell

2011-11-02 Thread Magicloud Magiclouds
On Wed, Nov 2, 2011 at 4:08 PM, Max Bolingbroke batterseapo...@hotmail.com wrote: On 2 November 2011 07:42, Magicloud Magiclouds magicloud.magiclo...@gmail.com wrote: How to avoid the name changing? Maybe you should use nameBase rather than show? Max Yes, that is one of the problem. And

[Haskell-cafe] Ridiculously slow FFI, or cairo binding?

2011-11-02 Thread Eugene Kirpichov
Hello, I've got two very simple programs that draw a very simple picture using cairo, doing a couple hundred thousand of cairo calls. One program is in C++. The other is in Haskell and uses the cairo library bindings. The C++ program completes in a fraction of a second, the Haskell program takes

Re: [Haskell-cafe] Ridiculously slow FFI, or cairo binding?

2011-11-02 Thread Eugene Kirpichov
I forgot to specify my environment. Windows Server 2008 R2 x64, ghc 7.0.3. However, I observed the same speed differences on a 64-bit ubuntu with ghc 6.12 - I profiled my application with cairo-trace, and cairo-perf-trace drew in a fraction of a second the picture that my Haskell program spend a

Re: [Haskell-cafe] HDBC SQLite error

2011-11-02 Thread Jurriën Stutterheim
I have just tried your suggestion (I explicitly committed right after opening a connection), but unfortunately it did not solve my problem. I've also tried compiling my app without threading, but it didn't seem to have any effect either. On 1 Nov 2011, at 19:03, Alexander Danilov wrote:

Re: [Haskell-cafe] Ridiculously slow FFI, or cairo binding?

2011-11-02 Thread Claude Heiland-Allen
On 02/11/11 09:17, Eugene Kirpichov wrote: Hello, I've got two very simple programs that draw a very simple picture using cairo, doing a couple hundred thousand of cairo calls. One program is in C++. The other is in Haskell and uses the cairo library bindings. The C++ program completes in a

Re: [Haskell-cafe] arr considered harmful

2011-11-02 Thread Ertugrul Soeylemez
Ryan Ingram ryani.s...@gmail.com wrote: I know it's a bit of an 'intentionally provocative' title, but with the recent discussions on Arrows I thought it timely to bring this up. Most of the conversion from arrow syntax into arrows uses 'arr' to move components around. However, arr is

Re: [Haskell-cafe] Ridiculously slow FFI, or cairo binding?

2011-11-02 Thread Eugene Kirpichov
Hi Claude, I suspected that the issue could be about unsafe foreign imports - all imports in the cairo bindings are safe. I compiled myself a version of cairo bindings with the rectangle and fill functions marked as unsafe. Unfortunately that didn't help the case at all, even though the core

Re: [Haskell-cafe] Ridiculously slow FFI, or cairo binding?

2011-11-02 Thread Vincent Hanquez
On 11/02/2011 09:51 AM, Eugene Kirpichov wrote: Hi Claude, I suspected that the issue could be about unsafe foreign imports - all imports in the cairo bindings are safe. I compiled myself a version of cairo bindings with the rectangle and fill functions marked as unsafe. Unfortunately that

Re: [Haskell-cafe] Ridiculously slow FFI, or cairo binding?

2011-11-02 Thread Eugene Kirpichov
Oh. This is pretty crazy, I wonder what they're doing with GMP so much... I modified the Haskell program to use cairo directly, even with safe calls, and it now takes the same time as the C program. {-# LANGUAGE ForeignFunctionInterface #-} module Main where import qualified

Re: [Haskell-cafe] Ridiculously slow FFI, or cairo binding?

2011-11-02 Thread Eugene Kirpichov
+gtk2hs-users On Wed, Nov 2, 2011 at 2:10 PM, Eugene Kirpichov ekirpic...@gmail.comwrote: Oh. This is pretty crazy, I wonder what they're doing with GMP so much... I modified the Haskell program to use cairo directly, even with safe calls, and it now takes the same time as the C program.

Re: [Haskell-cafe] Ridiculously slow FFI, or cairo binding?

2011-11-02 Thread Vincent Hanquez
On 11/02/2011 10:10 AM, Eugene Kirpichov wrote: Oh. This is pretty crazy, I wonder what they're doing with GMP so much... I modified the Haskell program to use cairo directly, even with safe calls, and it now takes the same time as the C program. yep, i ended up doing the exact same thing

Re: [Haskell-cafe] Ridiculously slow FFI, or cairo binding?

2011-11-02 Thread Eugene Kirpichov
Any idea how to debug why all the GMP calls? I'm looking at even the auto-generated source for cairo bindings, but I don't see anything at all that could lead to *thousands* of them. On Wed, Nov 2, 2011 at 2:14 PM, Vincent Hanquez t...@snarc.org wrote: On 11/02/2011 10:10 AM, Eugene Kirpichov

Re: [Haskell-cafe] Ridiculously slow FFI, or cairo binding?

2011-11-02 Thread Felipe Almeida Lessa
On Wed, Nov 2, 2011 at 8:15 AM, Eugene Kirpichov ekirpic...@gmail.com wrote: Any idea how to debug why all the GMP calls? I'm looking at even the auto-generated source for cairo bindings, but I don't see anything at all that could lead to *thousands* of them. Found them. Look at the Types

[Haskell-cafe] Fwd: Ridiculously slow FFI, or cairo binding?

2011-11-02 Thread Felipe Almeida Lessa
+gtk2hs-devel On Wed, Nov 2, 2011 at 8:15 AM, Eugene Kirpichov ekirpic...@gmail.com wrote: Any idea how to debug why all the GMP calls? I'm looking at even the auto-generated source for cairo bindings, but I don't see anything at all that could lead to *thousands* of them. Found them.  Look

Re: [Haskell-cafe] Fwd: Ridiculously slow FFI, or cairo binding?

2011-11-02 Thread Eugene Kirpichov
Yay!!! I made a small change in Types.chs and got my original cairo-binding-based program to be just as blazing fast. The only problem I have with this is that I used multiparameter type classes. Dear gtk2hs team! Is it possible to incorporate my changes? I'm pretty sure people will be happy by

Re: [Haskell-cafe] Fwd: Ridiculously slow FFI, or cairo binding?

2011-11-02 Thread Eugene Kirpichov
Sorry for re-sending, my previous attempt got ignored by gtk2hs-devel mailing list as I wasn't subscribed. Now I am. On Wed, Nov 2, 2011 at 3:14 PM, Eugene Kirpichov ekirpic...@gmail.comwrote: Yay!!! I made a small change in Types.chs and got my original cairo-binding-based program to be

Re: [Haskell-cafe] Fwd: Ridiculously slow FFI, or cairo binding?

2011-11-02 Thread Felipe Almeida Lessa
On Wed, Nov 2, 2011 at 9:14 AM, Eugene Kirpichov ekirpic...@gmail.com wrote: Yay!!! I made a small change in Types.chs and got my original cairo-binding-based program to be just as blazing fast. The only problem I have with this is that I used multiparameter type classes. Nice! Looking

Re: [Haskell-cafe] Fwd: Ridiculously slow FFI, or cairo binding?

2011-11-02 Thread Ivan Perez
Thanks a lot for this. I've been developing a Graphic Adventure IDE in haskell that I'm about to release. It uses Cairo to draw game-state diagrams and this will sure solve my speed issues. 2011/11/2 Felipe Almeida Lessa felipe.le...@gmail.com: On Wed, Nov 2, 2011 at 9:14 AM, Eugene Kirpichov

Re: [Haskell-cafe] Ridiculously slow FFI, or cairo binding?

2011-11-02 Thread Daniel Fischer
On Wednesday 02 November 2011, 10:19:08, Eugene Kirpichov wrote: I forgot to specify my environment. Windows Server 2008 R2 x64, ghc 7.0.3. However, I observed the same speed differences on a 64-bit ubuntu with ghc 6.12 - I profiled my application with cairo-trace, and cairo-perf-trace

Re: [Haskell-cafe] Ridiculously slow FFI, or cairo binding?

2011-11-02 Thread Jean-Marie Gaillourdet
Hi Eugene, did you try using the SPECIALIZE pragma? It is part of the Haskell 98 and Haskell 2010 specifications. On 02.11.2011, at 12:14, Eugene Kirpichov wrote: Yay!!! I made a small change in Types.chs and got my original cairo-binding-based program to be just as blazing fast. The

Re: [Haskell-cafe] Problem with TemplateHaskell

2011-11-02 Thread Magicloud Magiclouds
On Wed, Nov 2, 2011 at 4:50 PM, Magicloud Magiclouds magicloud.magiclo...@gmail.com wrote: On Wed, Nov 2, 2011 at 4:08 PM, Max Bolingbroke batterseapo...@hotmail.com wrote: On 2 November 2011 07:42, Magicloud Magiclouds magicloud.magiclo...@gmail.com wrote: How to avoid the name changing?

Re: [Haskell-cafe] Ridiculously slow FFI, or cairo binding?

2011-11-02 Thread Eugene Kirpichov
Hi, No, I didn't, as I read in the GHC docs that it is deprecated in favor of the RULES pragma (I wanted to replace specifically with floatToDouble and doubleToFloat). On Wed, Nov 2, 2011 at 5:24 PM, Jean-Marie Gaillourdet j...@gaillourdet.netwrote: Hi Eugene, did you try using the

Re: [Haskell-cafe] Ridiculously slow FFI, or cairo binding?

2011-11-02 Thread Felipe Almeida Lessa
On Wed, Nov 2, 2011 at 11:24 AM, Jean-Marie Gaillourdet j...@gaillourdet.net wrote: Hi Eugene, did you try using the SPECIALIZE pragma? It is part of the Haskell 98 and Haskell 2010 specifications. I don't think it's going to make any difference, as the core already have an specialized poor

[Haskell-cafe] Haskell hackers send an idea to the off the beaten track workshop at POPL

2011-11-02 Thread David Walker
Haskell is an amazing language for implementing Domain-Specific Languages. If you have an idea about a new domain-specific language you'd like to implement, a new problem that needs to be solved or any other new and unusual idea concerning programming language research, submit it to OBT: Off

Re: [Haskell-cafe] Ridiculously slow FFI, or cairo binding?

2011-11-02 Thread Eugene Kirpichov
Heh. Guess what! A simple {-# INLINE cFloatConv #-} helped to the same extent! Axel, I think this change should be pretty easy to incorporate, and it probably makes sense to inline all other functions in Types.chs too. Would you like me to send the trivial darcs patch or the gtk2hs team will

[Haskell-cafe] Tell cabal-install to generate only shared libraries

2011-11-02 Thread Yves Parès
Hello, When I tell cabal-install to build shared libraries (with Shared: True in .cabal/config), it doubles the libraries installation time since it compiles them twice, since it seems that is what GHC's flag -shared does. Is there a way to generate only the .so and not the the .a libs?

[Haskell-cafe] [ANNOUNCE] hierarchical-clustering-diagrams 0.1: diagrams of dendrograms

2011-11-02 Thread Felipe Almeida Lessa
Hello! I'm pleased to announce the very first version of hierarchical-clustering-diagrams [1]. This library builds upon Brent Yorgey's great diagrams library to draw diagrams of dendrograms. You can see an example diagram at [2]. This library has already been tested with a Real World Big Data

[Haskell-cafe] The type class wilderness + Separating instances and implementations into separate packages

2011-11-02 Thread Ryan Newton
What is the right interface for a queue? What is the right interface for a random number generator? I don't know, but in both cases you will find many packages on hackage offering different takes on the matter. In fact, there is a wilderness of alternative interfaces. We've had various

Re: [Haskell-cafe] happstack file serving

2011-11-02 Thread Jeremy Shaw
On Tue, Nov 1, 2011 at 9:48 AM, Gary Klindt gary.kli...@googlemail.com wrote: Hello all, I want to have a web application using one 'index.html' file with ajax requests and a happstack web server which response to server requests. For that purpose I need to use some javascript libraries in my

Re: [Haskell-cafe] Ridiculously slow FFI, or cairo binding?

2011-11-02 Thread wren ng thornton
On 11/2/11 9:24 AM, Jean-Marie Gaillourdet wrote: Hi Eugene, did you try using the SPECIALIZE pragma? It is part of the Haskell 98 and Haskell 2010 specifications. The problem with SPECIALIZE is that you still have to give a parametric definition for the function, whereas the whole point of

Re: [Haskell-cafe] Tell cabal-install to generate only shared libraries

2011-11-02 Thread Yves Parès
Apparently, disabling library vanilla causes GHC not to generate the .hi files : For instance when 'cabal install quickcheck --disable-library-vanilla': Registering QuickCheck-2.4.1.1... cabal: QuickCheck-2.4.1.1: file Test/QuickCheck/All.hi is missing (use --force to override)

Re: [Haskell-cafe] The type class wilderness + Separating instances and implementations into separate packages

2011-11-02 Thread Johan Tibell
These are all very good questions! Here's my stab at it: On Wed, Nov 2, 2011 at 11:28 AM, Ryan Newton rrnew...@gmail.com wrote: What is the right interface for a queue? What is the right interface for a random number generator? For any given class I'd try to get a few experts/interested

[Haskell-cafe] Haskell Weekly News: Issue 206

2011-11-02 Thread Daniel Santa Cruz
Welcome to issue 206 of the HWN, a newsletter covering developments in the Haskell community. This release covers the week of October 23 to 29, 2011. A HTML version of this issue can be found at: http://contemplatecode.blogspot.com/2011/11/haskell-weekly-news-issue-206.html Announcements

Re: [Haskell-cafe] Fwd: Ridiculously slow FFI, or cairo binding?

2011-11-02 Thread Eugene Kirpichov
Thanks! I'll definitely consider your library in the future, but for now, as we can see, there's no necessity in rewriting cFloatConv at all - {-# INLINE #-} suffices :) On Thu, Nov 3, 2011 at 3:30 AM, wren ng thornton w...@freegeek.org wrote: On 11/2/11 7:14 AM, Eugene Kirpichov wrote: I