Re: [Haskell-cafe] Code generation and optimisation for compiling Haskell

2012-01-13 Thread Thomas Schilling
JHC itself is based upon Boquist's GRIN language described in his PhD thesis: Code Optimization Techniques for Lazy Functional Languages http://mirror.seize.it/papers/Code%20Optimization%20Techniques%20for%20Lazy%20Functional%20Languages.pdf On 13 January 2012 01:50, Jason Dagit dag...@gmail.com

Re: [Haskell-cafe] named pipe interface

2012-01-13 Thread Chaddaï Fouché
On Thu, Jan 12, 2012 at 7:53 PM, Serge D. Mechveliani mech...@botik.ru wrote: People, (I wonder: is this for  beginn...@haskell.org ?) I don't think so. I need to organize a  string interface  for a Haskell function Main.axiom  and a C program                            fifoFromA.c via

Re: [Haskell-cafe] named pipe interface

2012-01-13 Thread Serge D. Mechveliani
On Fri, Jan 13, 2012 at 04:34:37PM +0100, Chadda?? Fouch?? wrote: On Thu, Jan 12, 2012 at 7:53 PM, Serge D. Mechveliani mech...@botik.ru wrote: People, (I wonder: is this for  beginn...@haskell.org ?) I don't think so. I need to organize a  string interface  for a Haskell

[Haskell-cafe] [ANNOUNCE] JuicyPixels 1.0 - image loading library

2012-01-13 Thread Vincent Berthoux
Hello, I'd like to announce the first release of JuicyPixels, an image loading library written entirely in Haskell. The focus of this library is ease of use and correct loading. In this first version the library is capable of the following actions : - PNG(.png) * Reading -

Re: [Haskell-cafe] named pipe interface

2012-01-13 Thread Brandon Allbery
On Fri, Jan 13, 2012 at 12:25, Serge D. Mechveliani mech...@botik.ruwrote: On Fri, Jan 13, 2012 at 04:34:37PM +0100, Chadda?? Fouch?? wrote: Now that seems interesting, but just to be clear : did you choose this solution (and why won't you use the FFI instead) or is this just to see how

[Haskell-cafe] STM atomic blocks in IO functions

2012-01-13 Thread Rob Stewart
Hi, My question is regarding the correct us of STM in Haskell. I have put to together a simple example, which represents more verbose code in a library that I am writing. The question is a simple one. Must all operations on a TVar happen within *the same* atomically block, or am I am I

Re: [Haskell-cafe] named pipe interface

2012-01-13 Thread Donn Cave
Quoth Serge D. Mechveliani mech...@botik.ru, [ ... why in Haskell instead of FFI ... ] Because it is a direct and the simplest approach. Why does one need a foreign language, if all the needed functions are in the standard Haskell library? The GHC Haskell library makes some compromises with

Re: [Haskell-cafe] named pipe interface

2012-01-13 Thread Michael Craig
Brandon, can you elaborate? Are you talking about UNIX named pipes or FIFO/queue data structures in general? Mike Craig On Fri, Jan 13, 2012 at 12:39 PM, Brandon Allbery allber...@gmail.comwrote: On Fri, Jan 13, 2012 at 12:25, Serge D. Mechveliani mech...@botik.ruwrote: On Fri, Jan 13,

Re: [Haskell-cafe] STM atomic blocks in IO functions

2012-01-13 Thread Bryan O'Sullivan
On Fri, Jan 13, 2012 at 10:04 AM, Rob Stewart robstewar...@googlemail.comwrote: The question is a simple one. Must all operations on a TVar happen within *the same* atomically block, or am I am I guaranteed thread safety if, say, I have a number of atomically blocks in an IO function. If

[Haskell-cafe] named pipes interface

2012-01-13 Thread Serge D. Mechveliani
I thank people for the notes. People write that the example without unsafePerformIO is desirable. So I present the improved question and improved, pure code. -- I need to organize a string interface for a Haskell function

Re: [Haskell-cafe] feed release plan

2012-01-13 Thread Simon Michael
Aha, thanks both. The haskell organisation looks bigger, I think I'd like to upload feed there. Could the owner add contact info or a how-to-join note to the page ? -Simon On 1/10/12 12:22 PM, David Terei wrote: There is also: https://github.com/haskell where a bunch of us are hosting

Re: [Haskell-cafe] named pipe interface

2012-01-13 Thread Serge D. Mechveliani
I (Sergei) am invesigating (so far) only Unix named pipes. I hope you are aware of the many gotchas involved with FIFOs. There are very good reasons why they are not widely used. At least in C - C, the Unix named pipes do work. And I am trying to replace the first end with Haskell. On

Re: [Haskell-cafe] named pipe interface

2012-01-13 Thread Serge D. Mechveliani
On Fri, Jan 13, 2012 at 10:08:04AM -0800, Donn Cave wrote: Quoth Serge D. Mechveliani mech...@botik.ru, [ ... why in Haskell instead of FFI ... ] Because it is a direct and the simplest approach. Why does one need a foreign language, if all the needed functions are in the standard

Re: [Haskell-cafe] named pipe interface

2012-01-13 Thread Brandon Allbery
On Fri, Jan 13, 2012 at 13:23, Michael Craig mks...@gmail.com wrote: Brandon, can you elaborate? Are you talking about UNIX named pipes or FIFO/queue data structures in general? I mean POSIX named pipes. They work, but they don't do what most people think they do, and they're rather annoying

Re: [Haskell-cafe] named pipe interface

2012-01-13 Thread Serge D. Mechveliani
On Fri, Jan 13, 2012 at 04:34:37PM +0100, Chadda?? Fouch?? wrote: On Thu, Jan 12, 2012 at 7:53 PM, Serge D. Mechveliani mech...@botik.ru wrote: [..] I need to organize a  string interface  for a Haskell function Main.axiom  and a C program                            fifoFromA.c via

Re: [Haskell-cafe] feed release plan

2012-01-13 Thread Johan Tibell
On Fri, Jan 13, 2012 at 10:46 AM, Simon Michael si...@joyful.com wrote: Aha, thanks both. The haskell organisation looks bigger, I think I'd like to upload feed there. Could the owner add contact info or a how-to-join note to the page ? The Haskell organization on GitHub is for core libraries

Re: [Haskell-cafe] named pipe interface

2012-01-13 Thread Donn Cave
Quoth Serge D. Mechveliani mech...@botik.ru, ... Initially, I did the example by the Foreign Function Interface for C. But then, I thought But this is unnatural! Use plainly the standard Haskell IO, it has everything. So, your advice is return to FFI ? Well, it turns out that the I/O system

Re: [Haskell-cafe] [Haskell] [ANNOUNCE] JuicyPixels 1.0 - image loading library

2012-01-13 Thread Daniel Díaz Casanueva
Thanks for this upload! I searched something like this a time ago. I'll test it soon and, if I have any issue, send you some feedback. Thanks again for the work. I made a library to work with PPM images (not released to Hackage), but I'm glad to see a Haskell implementation of PNG and JPG. Good

[Haskell-cafe] How to make asynchronous I/O composable and safe?

2012-01-13 Thread Joey Adams
I'm not happy with asynchronous I/O in Haskell.  It's hard to reason about, and doesn't compose well.  At least in my code. I'm currently trying to build a networking layer for my application using Network.TLS.  Here is a rather minimalist API:    newtype Connection = Connection (TLSCtx Handle)

Re: [Haskell-cafe] How to make asynchronous I/O composable and safe?

2012-01-13 Thread Bardur Arantsson
On 01/14/2012 06:24 AM, Joey Adams wrote: I'm not happy with asynchronous I/O in Haskell. It's hard to reason about, and doesn't compose well. At least in my code. [--snip--] Async I/O *is* tricky if you're expecting threads to do their own writes/reads directly to/from sockets. I find