Re: [Haskell-cafe] [C Binding] Turning the mutable to immutable?

2010-07-07 Thread Edward Z. Yang
To answer the question in your subject, “Very Carefully.” While I don’t know much about your particular problem domain (and it seems others have given useful advice), I can say some general things about making mutable things immutable. There is a very simple way to make something mutable immutabl

Re: [Haskell-cafe] [C Binding] Turning the mutable to immutable?

2010-07-07 Thread Yves Parès
Okay, so I think that the better idea is to carry on with my low-level, imperative binding, and then build a more functional on top of this. Concerning the mutability of images, I notice that the problem with SFML is that it handles Sprites in a way that is even more imperative than OpenGL texture

Re: [Haskell-cafe] [C Binding] Turning the mutable to immutable?

2010-07-07 Thread Sebastian Sylvan
On Wed, Jul 7, 2010 at 2:24 PM, Yves Parès wrote: > > 2010/7/7 Liam O'Connor > > > Making an immutable API from a mutable one generally damages performance > (on von neumann architectures) somewhat, the goal is to minimize that > impact. > > In fact, I would like to determine if an EFFICIENT way

Re: [Haskell-cafe] [C Binding] Turning the mutable to immutable?

2010-07-07 Thread Yves Parès
> 2010/7/7 Liam O'Connor > Making an immutable API from a mutable one generally damages performance (on von neumann architectures) somewhat, the goal is to minimize that impact. In fact, I would like to determine if an EFFICIENT way to make images and such immutable exists, or if it is impossible

Re: [Haskell-cafe] [C Binding] Turning the mutable to immutable?

2010-07-07 Thread Chris Eidhof
I think it might influence performance, but it doesn't have to be that much. There are some optimization tricks you can apply to deal with this. Premature optimization is the root of all evil ;) -chris On 7 jul 2010, at 11:40, Yves Parès wrote: > That's indeed an advice I've read [1]. > But wo

Re: [Haskell-cafe] [C Binding] Turning the mutable to immutable?

2010-07-07 Thread Liam O'Connor
Making an immutable API from a mutable one generally damages performance (on von neumann architectures) somewhat, the goal is to minimize that impact. Cheers. ~Liam On 7 July 2010 19:40, Yves Parès wrote: > That's indeed an advice I've read [1]. > But wouldn't it damage the performances, sinc

Re: [Haskell-cafe] [C Binding] Turning the mutable to immutable?

2010-07-07 Thread Yves Parès
That's indeed an advice I've read [1]. But wouldn't it damage the performances, since code will have to go through an extra layer? [1] http://blog.ezyang.com/2010/06/principles-of-ffi-api-design 2010/7/7 Chris Eidhof > On 5 jul 2010, at 23:48, Yves Parès wrote: > > > Hello, > > > > I don't know

Re: [Haskell-cafe] [C Binding] Turning the mutable to immutable?

2010-07-07 Thread Chris Eidhof
On 5 jul 2010, at 23:48, Yves Parès wrote: > Hello, > > I don't know if some of you are familiar with the SFML library (stands for > Simple and Fast Multimedia Library) --> http://sfml-dev.org > As SDL, SFML is a 2D graphics library, but conversely to SDL it provides a > hardware-accelerated dr

Re: [Haskell-cafe] [C Binding] Turning the mutable to immutable?

2010-07-05 Thread Jake McArthur
On 07/05/2010 04:48 PM, Yves Parès wrote: 3) Is there another library on hackage that handles images in a functional way? (I mean not /all in IO/) Check out graphics-drawingcombinators. - Jake ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org ht

[Haskell-cafe] [C Binding] Turning the mutable to immutable?

2010-07-05 Thread Yves Parès
Hello, I don't know if some of you are familiar with the SFML library (stands for Simple and Fast Multimedia Library) --> http://sfml-dev.org As SDL, SFML is a 2D graphics library, but conversely to SDL it provides a hardware-accelerated drawing, through OpenGL. Well, I'm currently writing its Has