
On Sun, Dec 11, 2005 at 02:25:55AM +0300, Bulat Ziganshin wrote:
don't forget that real program will make a lot of I/O and use C libraries, so difference will be less and can be even close to 0.
I disagree that every real Haskell program has to do a lot of I/O and has to use FFI. Most of the time I want to write my code in pure Haskell, with 95% of it in pure functions. This has the advantage of greater clarity and reliability (and more). What I fear about the future of Haskell, is that we will have so many libraries FFIying to C, that our programs will crash as often as programs written in C. FFI is necessary, but IMO it shouldn't be used when it doesn't have to be. In an (mostly:) ideal world, every library should be clearly divided into a small, trusted, unsafe core and the rest, written entirely in Haskell. I would like to see some support in tools for enforcing such a coding policy. It could look like this - a function written using only safe components would be marked as safe. Every unsafe feature like FFI, unsafePerformIO, etc. would "taint" a module/function, marking it unsafe. You could explicitly tag module/function as trusted/reviewed/etc. There would be different levels of trust. All this would be propagated through the libs and program modules. A Haskell IDE could mark safe/unsafe/trusted code with different background color, etc. You could get statistics about the proportions of safe/unsafe/trusted code. Best regards Tomasz -- I am searching for a programmer who is good at least in some of [Haskell, ML, C++, Linux, FreeBSD, math] for work in Warsaw, Poland