Re: [Haskell-cafe] memory-efficient data type for Netflix data - UArray Int Int vs UArray Int Word8

2009-02-23 Thread Don Stewart
bos:
 2009/2/23 Kenneth Hoste kenneth.ho...@ugent.be
  
 
 Does anyone know why the Word8 version is not significantly better in 
 terms
 of memory usage?
 
 
 Yes, because there's a typo on line 413 of Data/Array/Vector/Prim/BUArr.hs.
 
 How's that for service? :-)

UArray or UArr?
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Pickling a finite map (Binary + zlib) [was: [Haskell-cafe] Data.Binary poor read performance]

2009-02-23 Thread Don Stewart
wren:
 Neil Mitchell wrote:
 2) The storage for String seems to be raw strings, which is nice.
 Would I get a substantial speedup by moving to bytestrings instead of
 strings? If I hashed the strings and stored common ones in a hash
 table is it likely to be a big win?

 Bytestrings should help. The big wins in this application are likely to  
 be cache issues, though the improved memory/GC overhead is nice too.


Here's a quick demo using Data.Binary directly.

First, let's read in the dictionary file, and build a big, worst-case finite
map of words to their occurence (always 1).

import Data.Binary
import Data.List
import qualified Data.ByteString.Char8 as B
import System.Environment
import qualified Data.Map as M

main = do
[f] - getArgs
s   - B.readFile f
let m = M.fromList [ (head n, length n) | n - (group . B.lines $ s) ]
encodeFile dict m
print done

So that writes a dict file with a binary encoded Map ByteString Int.
Using ghc -O2 --make for everying.

$ time ./A /usr/share/dict/cracklib-small
done
./A /usr/share/dict/cracklib-small  0.28s user 0.03s system 94% cpu 0.331 
total

Yields a dictionary file Map:

$ du -hs dict
1.3Mdict

Now, let's read back in and decode it back to a Map 

main = do
[f] - getArgs
m   - decodeFile f
print (M.size (m :: M.Map B.ByteString Int))
print done

Easy enough:

$ time ./A dict +RTS -K20M
52848
done
./A dict +RTS -K20M  1.51s user 0.06s system 99% cpu 1.582 total


Ok. So 1.5s to decode a 1.3M Map. There may be better ways to build the Map 
since we know the input will be sorted, but
the Data.Binary instance can't do that.

Since decode/encode are a nice pure function on lazy bytestrings, we can try a 
trick of 
compressing/decompressing the dictionary in memory.

Compressing the dictionary:

import Data.Binary
import Data.List
import qualified Data.ByteString.Char8 as B
import qualified Data.ByteString.Lazy  as L
import System.Environment
import qualified Data.Map as M
import Codec.Compression.GZip

main = do
[f] - getArgs
s   - B.readFile f
let m = M.fromList [ (head n, length n) | n - (group . B.lines $ s) ]
L.writeFile dict.gz . compress . encode $ m
print done

Pretty cool, imo, is compress . encode:

$ time ./A /usr/share/dict/cracklib-small 
done
./A /usr/share/dict/cracklib-small  0.38s user 0.02s system 85% cpu 0.470 
total

Ok. So building a compressed dictionary takes only a bit longer than 
uncompressed one (zlib is fast),

$ du -hs dict.gz 
216Kdict.gz

Compressed dictionary is much smaller. Let's load it back in and unpickle it:

main = do
[f] - getArgs
m - (decode . decompress) `fmap` L.readFile f
print (M.size (m :: M.Map B.ByteString Int))
print done

Also cute. But how does it run:

$ time ./A dict.gz
52848
done
./A dict.gz  0.28s user 0.03s system 98% cpu 0.310 total

Interesting. So extracting the Map from a compressed bytestring in memory is a 
fair bit faster than loading it 
directly, uncompressed from disk.

Neil, does that give you some ballpark figures to work with?

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] The community is more important than the product

2009-02-21 Thread Don Stewart
http://haskell.org/haskellwiki/Protect_the_community

Random notes on how to maintain tone, focus and productivity in an
online community I took a few years ago.

Might be some material there if anyone's seeking to help ensure
we remain a constructive, effective community.

-- Don

P.S. release some code on hackage.haskell.org.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Re: Template Haskell compilation error on Windows (was Re: speed: ghc vs gcc)

2009-02-21 Thread Don Stewart
Missing --make

bugfact:
 I tried to compile the template Haskell loop unrolling trick from Claus Reinke
 on my machine which is running Windows and GHC 6.10.1, and I got linker 
 errors.
 
 c:\tempghc -O2 -fvia-C -optc-O3 -fforce-recomp Apply.hs
 Apply.o:ghc6140_0.hc:(.text+0x7d): undefined reference to
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-21 Thread Don Stewart

Bulat, you've some serious lessons to learn on how to interact with
online communities. First,

1. Stop posting replies to every post on this thread

2. Read some of the fine literature on how to be a productive,
contributing member of a mailing list community,

http://haskell.org/haskellwiki/Protect_the_community

3. Then see if you can rephrase your concerns in a form that will be
useful. Claus (as always) has made a fine suggestion:


http://www.haskell.org/pipermail/haskell-cafe/2009-February/056241.html

3. Come back with some analysis, or a ticket, and authentically try
to collaborate with people here to improve or fix the problems you see.

I'm setting your moderation bit now, and in public so we all know what
is going on, so your posts will bounce until you do something
constructive. This will likely expire in a few days - just enough to
calm things down.

-- Don (on jerk police protrol today)


P.S. if anyone strongly objects, let's talk offline how better to manage things.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Re: [Haskell] ANNOUNCE: X Haskell Bindings 0.2

2009-02-21 Thread Don Stewart
aslatter:
 I'd like to announce the 0.2.* series release of the X Haskell
 Bindings.  This release, like the prior 0.1.* series focuses on making
 the API prettier.  This does mean that there's a good chance this is a
 breaking release.  Also, 0.2.* is based on the just-released version
 1.4 of the XML descriptions of the X protocol.
 
 The goal of XHB is to provide a Haskell implementation of the X11 wire
 protocol, similar in spirit to the X protocol C-language Binding
 (XCB).
 
 On Hackage: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/xhb

Woo, well done! Here's an Arch Linux package,

http://aur.archlinux.org/packages.php?ID=23765

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] speed: ghc vs gcc

2009-02-20 Thread Don Stewart
bulat.ziganshin:
 Hello haskell-cafe,
 
 since there are no objective tests comparing ghc to gcc, i made my own
 one. these are 3 programs, calculating sum in c++ and haskell:

Wonderful. Thank you!
  
 main = print $ sum[1..10^9::Int]


This won't be comparable to your loop below, as 'sum' is a left fold
(which doesn't fuse under build/foldr).

You should use the list implementation from the stream-fusion package (or
uvector) if you're expecting it to fuse to the following loop:
  
 main = print $ sum0 (10^9) 0
 
 sum0 :: Int - Int - Int
 sum0 0  !acc = acc
 sum0 !x !acc = sum0 (x-1) (acc+x)


Note the bang patterns aren't required here. It compiles to the
following core:

$wsum0 :: Int# - Int# - Int#
$wsum0 =
  \ (ww_sON :: Int#) (ww1_sOR :: Int#) -
  case ww_sON of ds_XD0 {
_ - $wsum0 (-# ds_XD0 1) (+# ww1_sOR ds_XD0);
0 - ww1_sOR

which is perfect.

Main_zdwsum0_info:
  testq   %rsi, %rsi
  movq%rsi, %rax
  jne .L2
  movq%rdi, %rbx
  jmp *(%rbp)
.L2:
  leaq-1(%rsi), %rsi
  addq%rax, %rdi
  jmp Main_zdwsum0_info

Which seems ... OK.

$ ghc-core A.hs -fvia-C -optc-O3
$ time ./A
55
./A  1.12s user 0.00s system 99% cpu 1.127 total
  
Works for me. That's on linux x86_64, gcc 4.4

Trying -fasm:

Main_zdwsum0_info:
.LcQs:
  movq %rsi,%rax
  testq %rax,%rax
  jne .LcQw
  movq %rdi,%rbx
  jmp *(%rbp)
.LcQw:
  movq %rdi,%rcx
  addq %rax,%rcx
  leaq -1(%rax),%rsi
  movq %rcx,%rdi
  jmp Main_zdwsum0_info

$ time ./A
55
./A  1.65s user 0.00s system 98% cpu 1.677 total

Is  a bit slower.

 main()
 {
   int sum=0;
   //for(int j=0; j100;j++)
 for(int i=0; i1000*1000*1000;i++)
   sum += i;
   return sum;
 }


Well, that's a bit different. It doesn't print the result, and it returns a 
different
results on 64 bit


$ gcc -O0 t.c
$ time ./a.out 
-1243309312
./a.out  3.99s user 0.00s system 88% cpu 4.500 total

$ gcc -O1 t.c
$ time ./a.out
-1243309312
./a.out  0.88s user 0.00s system 99% cpu 0.892 total

$ gcc -O3 -funroll-loops t.c 
$ time ./a.out
-1243309312
./a.out  0.31s user 0.00s system 97% cpu 0.318 total

I don't get anything near the 0.062s which is interesting.
The print statement slows things down, I guess...

So we have:

ghc -fvia-C -O2 1.127
ghc -fasm   1.677
gcc -O0 4.500
gcc -O3 -funroll-loops  0.318

So. some lessons. GHC is around 3-4x slower on this tight loop. (Which isn't as
bad as it used to be).

That's actually a worse margin than any current shootout program, where we are 
no 
worse than 2.9 slower on larger things:


http://shootout.alioth.debian.org/u64q/benchmark.php?test=alllang=ghclang2=gccbox=1

 
 execution times:
  sum:
ghc 6.6.1 -O2   : 12.433 secs
ghc 6.10.1 -O2  : 12.792 secs
  sum-fast:
ghc 6.6.1 -O2   :  1.919 secs
ghc 6.10.1 -O2  :  1.856 secs
ghc 6.10.1 -O2 -fvia-C  :  1.966 secs
  C++:
gcc 3.4.5 -O3 -funroll-loops:  0.062 secs
 

I couldn't reproduce your final number. 

Now, given GHC gets most of the way there -- I think this might make a good bug
report against GHC head, so we can see if the new register allocator helps any.

http://hackage.haskell.org/trac/ghc/newticket?type=bug

Thanks for the report, Bulat!

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] speed: ghc vs gcc

2009-02-20 Thread Don Stewart
bulat.ziganshin:
 Friday, February 20, 2009, 7:41:33 PM, you wrote:
 
  main = print $ sum[1..10^9::Int]
 
  This won't be comparable to your loop below, as 'sum' is a left fold
  (which doesn't fuse under build/foldr).
 
  You should use the list implementation from the stream-fusion package (or
  uvector) if you're expecting it to fuse to the following loop:
 
 it was comparison of native haskell, low-level haskell (which is
 harder to write than native C) and native C. stream-fusion and any
 other packages provides libraries for some tasks but they can't make faster
 maps, for example. so i used plain list


Hmm? Maybe you're not familiar with the state of the art?

$ cabal install uvector

Write a loop at a high level:

import Data.Array.Vector

main = print (sumU (enumFromToU 1 (10^9 :: Int)))
   
Compile it:

$ ghc-core A.hs -O2 -fvia-C -optc-O3

Yielding:

s16h_info:
  cmpq6(%rbx), %rdi
  jg  .L2
  addq%rdi, %rsi
  leaq1(%rdi), %rdi
  jmp s16h_info

Running:

$ time ./A
55
./A  0.97s user 0.01s system 99% cpu 0.982 total


Now, (trying to avoid the baiting...) this is actually *very*
interesting. Why is this faster than the manual recursion we did earlier
why do we get better assembly?  Again, if you stick to specifics, there's some
interesting things we can learn here.

  
  Which seems ... OK.
 
 really? :D

No, see above.

  
  I don't get anything near the 0.062s which is interesting.
 
 it was beautiful gcc optimization - it added 8 values at once. with
 xor results are:
 
 xor.hs  12.605
 xor-fast.hs  1.856
 xor.cpp  0.339


GCC is a good loop optimiser. But apparently not my GCC.

  
  So we have:
 
  ghc -fvia-C -O2 1.127
  ghc -fasm   1.677
  gcc -O0 4.500
  gcc -O3 -funroll-loops  0.318
 
 why not compare to ghc -O0? also you can disable loop unrolling in gcc
 and unroll loops manually in haskell. or you can generate asm code on
 the fly. there are plenty of tricks to prove that gcc generates bad
 code :D


No, we want to show (I imagine) that GHC is within a factor or two of C.
I usually set my benchmark to beat gcc -O0 fwiw, and then to hope to be within
2x of optimised C. I'm not sure what you're standards are.

  
  So. some lessons. GHC is around 3-4x slower on this tight loop. (Which 
  isn't as
  bad as it used to be).
 
 really? what i see: low-level haskell code is usually 3 times harder
 to write and 3 times slower than gcc code. native haskell code is tens
 to thousands times slower than C code (just recall that real programs
 use type classes and monads in addition to laziness)


thousands times, now you're just undermining your own credibility
here. Stick to what you can measure. If anything we'd expect GCC's magic loop
skillz to be less useful on large code bases.

  
  That's actually a worse margin than any current shootout program, where we 
  are no
  worse than 2.9 slower on larger things:
 
 1) most benchmarks there depend on libraries speed. in one test, for
 example, php is winner
 2) for the sum program ghc libs was modified to win in benchmark


It is interesting that the  2.9x slower in the shootout is pretty much what
we found in this benchmark too. 

 3) the remaining 1 or 2 programs that measure speed of ghc-generated
 code was hardly optimized using low-level code, so they don't have
 anything common with real haskell code most of us write every day


Depends on where you work.

  
  Now, given GHC gets most of the way there -- I think this might make a good 
  bug
  report against GHC head, so we can see if the new register allocator helps 
  any.
 
 you mean that 6.11 includes new allocator? in that case you can
 test it too

Yes.


http://hackage.haskell.org/trac/ghc/wiki/Commentary/Compiler/IntegratedCodeGen
  

 i believe that ghc developers are able to test sum performance without my
 bugreports :D

No! This is not how open source works! You *should submit bug reports* and 
*analysis*.
It is so so much more useful than complaining and throwing stones.

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Don Stewart
barsoap:
 Don Stewart d...@galois.com wrote:
 
  No! This is not how open source works! You *should submit bug
  reports* and *analysis*. It is so so much more useful than
  complaining and throwing stones.
 
 Exactly. I don't know where, but I read that the vast majorities of
 Linux bugs are reported, nailed, and then fixed, by at least three
 different persons: The first reports a misbehaviour, the second manages
 to find it surfacing in a certain line of code, the third instantly
 knows how to make it go away.

Elaboarting further:


Thinking more about Bulat's code gen observations, I think there's something
wrong here -- other than that GHC needs the new codegen to do any of the
fancier loop optimisations.

If we take what I usually see as the best loops GHC can do for this kind of 
thing:

import Data.Array.Vector

main = print (sumU (enumFromToU 1 (10^9 :: Int)))

And compile it:

$ ghc-core A.hs -O2 -fvia-C -optc-O3

We get ideal core, all data structures fused away, and no heap allocation:

$wfold_s15t :: Int# - Int# - Int#
$wfold_s15t =
  \ (ww1_s150 :: Int#) (ww2_s154 :: Int#) -
case # ww2_s154 ww_s14U of wild_aWm {
  False -
$wfold_s15t
  (+# ww1_s150 ww2_s154) (+# ww2_s154 1);
  True - ww1_s150
}; } in
case $wfold_s15t 0 1

Which produces nice assembly:

s16e_info:
  cmpq6(%rbx), %rdi
  jg  .L2
  addq%rdi, %rsi
  leaq1(%rdi), %rdi
  jmp s16e_info

This is the best GHC will do here, in my experience, and I'm satisifed with it.

Short of new backend tweaks, and realising that GHC is not the loop magic 
compiler GCC is.


http://hackage.haskell.org/trac/ghc/wiki/Commentary/Compiler/IntegratedCodeGen

We can be happy with this. The compiler is doing exactly what we expect.

$ time ./B
55
./B  0.96s user 0.00s system 99% cpu 0.967 total

Now, going back to the low level version, Bulat's loop:

main()
{
  int sum=0;
  //for(int j=0; j100;j++)
for(int i=0; i1000*1000*1000;i++)
  sum += i;
  return sum;
}

What was first confusing for me was that he wrote the loop backwards when 
translating to Haskell,
like this:

main = print $ sum0 (10^9) 0

sum0 :: Int - Int - Int
sum0 0  !acc = acc
sum0 !x !acc = sum0 (x-1) (acc+x)

(The bang patterns aren't needed). Note how he counts backwards from 10^9. Was 
there a reason for that, Bulat?

I wondered if we just got worse code on backwards counting loops. So
translating into the obvious translation, counting up:

main = print (sum0 0 1)

sum0 :: Int - Int - Int
sum0 acc n | n  10^9  = acc
   | otherwise = sum0 (acc + n) (n + 1)

Which I actually consider to be the same difficulty as writing the C version, 
fwiw... 
We start to notice something interesting:


$wsum0 :: Int# - Int# - Int#
$wsum0 =
  \ (ww_sOH :: Int#) (ww1_sOL :: Int#) -
case lvl2 of wild1_aHn { I# y_aHp -
case # ww1_sOL y_aHp of wild_B1 {
  False -
letrec {

  $wsum01_XPd :: Int# - Int# - Int#
  $wsum01_XPd =
\ (ww2_XP4 :: Int#) (ww3_XP9 :: Int#) -
  case # ww3_XP9 y_aHp of wild11_Xs {
False -
  $wsum01_XPd (+# ww2_XP4 ww3_XP9) (+# ww3_XP9 1);
True - ww2_XP4
  }; } in
$wsum01_XPd (+# ww_sOH ww1_sOL) (+# ww1_sOL 1);

  True - ww_sOH
}

Why is there an extra test? What is GHC doing?
Checking the asm:

$ ghc -O2 -fasm

sQ3_info:
.LcRt:
  cmpq 8(%rbp),%rsi
  jg .LcRw
  leaq 1(%rsi),%rax
  addq %rsi,%rbx
  movq %rax,%rsi
  jmp sQ3_info

$ time ./B
55
./B  1.30s user 0.01s system 98% cpu 1.328 total

So its a fair bit slower. Now, we should, as a principle, be able to write sum 
directly as I did , and get the
same code from the manual, and automatically , fused version. But we didn't.

Checking via C:

   $ ghc -O2 -optc-O3 -fvia-C

Better code, but still a bit slower:   

sQ3_info:
  cmpq8(%rbp), %rsi
  jg  .L8
  addq%rsi, %rbx
  leaq1(%rsi), %rsi
  jmp sQ3_info

Running:

$ time   ./B
55
./B  1.01s user 0.01s system 97% cpu 1.035 total

So I think we have a bug report! Why did GHC put that extra test in place?

Now, none of this addresses (I think) Bulat's point that GCC can unroll loops 
and do other loop magic.
That's handled under a different workflow - the new code generator.

I'll create the ticket.

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Don Stewart
claus.reinke:
 Concrete examples always help, thanks.

 In simple enough situations, one can roll one's own loop unrolling;),
 somewhat like shown below (worker/wrapper split to bring the function
 parameter representing the loop body into scope, then template haskell  
 to unroll its applications syntactically, then optimization by 
 transformation
 to get rid of the extra code). It is all rather more complicated than one
 would like it to be, what with TH scoping restrictions and all, but 
 perhaps a library of self-unrolling loop combinators along these lines 
 might help, as a workaround until ghc does its own unrolling.

 Claus

 {-# LANGUAGE TemplateHaskell #-}
 module Apply where
 import Language.Haskell.TH.Syntax
 apply i bound | ibound   = [| \f x - $(apply (i+1) bound) f (f i x) |]
  | otherwise = [| \f x - x |]

 {-# LANGUAGE CPP #-}
 {-# LANGUAGE TemplateHaskell #-}
 {-# LANGUAGE BangPatterns #-}
 {-# OPTIONS_GHC -DN=8 -ddump-splices #-}
 module Main(main) where
 import Apply
 main = print $ loopW 1 (10^9) body 0

 {-# INLINE loopW #-}
 loopW :: Int - Int - (Int - Int - Int) - Int - Int
 loopW i max body acc = loop i acc
  where
  loop :: Int - Int - Int
  loop !i !acc | i+N=max  = loop (i+N) ($(apply (0::Int) N) (\j acc-body 
 (i+j) acc) acc)
  {-
  loop !i !acc | i+8=max  = loop (i+8) ( body (i+7)
$ body (i+6)
$ body (i+5)
$ body (i+4)
$ body (i+3)
$ body (i+2)
$ body (i+1)
$ body i acc)
  -}
  loop !i !acc | i=max= loop (i+1) (body i acc)
   | otherwise = acc

 body :: Int - Int - Int
 body !i !acc = i+acc


Great thinking! This is EXTREMELY COOL!

Main.hs:15:42-57: Splicing expression
let
  apply = apply
  $dOrd = GHC.Base.$f1
  $dNum = GHC.Num.$f6
  $dLift = Language.Haskell.TH.Syntax.$f18
in apply (0 :: Int) 8
  ==
\ f[a1KU] x[a1KV]
- \ f[a1KW] x[a1KX]
   - \ f[a1KY] x[a1KZ]
  - \ f[a1L0] x[a1L1]
 - \ f[a1L2] x[a1L3]
- \ f[a1L4] x[a1L5]
   - \ f[a1L6] x[a1L7]
  - \ f[a1L8] x[a1L9]
 - \ f[a1La] 
x[a1Lb] - x[a1Lb]
  f[a1L8] 
(f[a1L8] 7 x[a1L9])
   f[a1L6] (f[a1L6] 
6 x[a1L7])
f[a1L4] (f[a1L4] 5 
x[a1L5])
 f[a1L2] (f[a1L2] 4 x[a1L3])
  f[a1L0] (f[a1L0] 3 x[a1L1])
   f[a1KY] (f[a1KY] 2 x[a1KZ])
f[a1KW] (f[a1KW] 1 x[a1KX])
 f[a1KU] (f[a1KU] 0 x[a1KV])
In the second argument of `loop', namely
`($(apply (0 :: Int) 8) (\ j acc - body (i + j) acc) acc)'
In the expression:
loop
  (i + 8) ($(apply (0 :: Int) 8) (\ j acc - body (i + j) acc) acc)
In the definition of `loop':
loop !i !acc
   | i + 8 = max
   = loop
   (i + 8) ($(apply (0 :: Int) 8) (\ j acc - body (i + j) 
acc) acc)

So, that's the fastest yet:

$ time ./Main
55
./Main  0.61s user 0.00s system 98% cpu 0.623 total

And within 2x the best GCC was doing,

 gcc -O3 -funroll-loops  0.318

If we unroll even further...

$ ghc -O2 -fvia-C -optc-O3 -D64 Main.hs

$ time ./Main
55
./Main  0.08s user 0.00s system 94% cpu 0.088 total

Very very nice, Claus!

Now I'm wondering if we can do this via rewrite rules

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Don Stewart
bulat.ziganshin:
 Hello Achim,
 
 Friday, February 20, 2009, 11:44:49 PM, you wrote:
 
   Turning this into a ticket with associated test will:
  
  but why you think that this is untypical and needs a ticket? ;)
  
  Bulat, you are right in every aspect. You never did anything wrong.
 
 Achim, this is simplest code one can imagine. so when Simon will go to
 check ghc optimizations, he will try it without any reports. but
 Simon, unlike Don, never said that ghc may be compared to gcc. Don, on
 the other hand, say this everyday. when he is asked for code that
 shows this, he declined to answer. so - why YOU think that ghc
 generates fast code and this example is something unusual? can you
 provide any *technical* arguments or will continue to make personal
 attacks together with Don?

Bulat, you misunderstand, it is not personal! We just want something to
work on. Something specific.

For example, you've identified loop unrolling as something that could
very profitably be improved in GHC, and Claus even wrote a prototype to
see what kind of speedups to guess. 

This is a great contribution!  Now we know where to hunt.

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Don Stewart
dons:
 bulat.ziganshin:
  Hello Achim,
  
  Friday, February 20, 2009, 11:44:49 PM, you wrote:
  
Turning this into a ticket with associated test will:
   
   but why you think that this is untypical and needs a ticket? ;)
   
   Bulat, you are right in every aspect. You never did anything wrong.
  
  Achim, this is simplest code one can imagine. so when Simon will go to
  check ghc optimizations, he will try it without any reports. but
  Simon, unlike Don, never said that ghc may be compared to gcc. Don, on
  the other hand, say this everyday. when he is asked for code that
  shows this, he declined to answer. so - why YOU think that ghc
  generates fast code and this example is something unusual? can you
  provide any *technical* arguments or will continue to make personal
  attacks together with Don?
 
 Bulat, you misunderstand, it is not personal! We just want something to
 work on. Something specific.
 
 For example, you've identified loop unrolling as something that could
 very profitably be improved in GHC, and Claus even wrote a prototype to
 see what kind of speedups to guess. 
 
 This is a great contribution!  Now we know where to hunt.

And just to summarise what we have seen:

ghc -O2 naive left fold15.680
gcc -O0 4.500
ghc manual recursion -fasm  1.328
ghc manual recursion1.035
ghc naive left fold stream fusion 0.967
gcc -O1 0.892
ghc -funroll-loops -D80.623
gcc -O3 -funroll-loops  0.318
ghc -funroll-loops -D64   0.088

So what did we learn here?

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Don Stewart
bulat.ziganshin:
 Hello Achim,
 
 Saturday, February 21, 2009, 1:17:08 AM, you wrote:
 
  nothing new: what you are not interested in real compilers comparison,
  preferring to demonstrate artificial results
 
  ...that we have a path to get better results than gcc -O3
  -funroll-loops, and it's within reach... we even can get there now,
  albeit not in the most hack-free way imaginable?
 
 well, can this be made for C++? yes. moreover, gcc does this trick
 *automatically*, while with ghc we need to write 50-line program using
 Template Haskell and then run it through gcc - and finally get exactly
 the same optimization we got automatic for C code
 
 so, again: this confirms that Don is always build artificial
 comparisons, optimizing Haskell code by hand and ignoring obvious ways
 to optimize Haskell code. unfortunately, this doesn't work in real
 live. and even worse - Don reports this as fair Haskell vs C++
 comparison

This is extremely depressing to read after the good results and lessons of this 
thread.

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] speed: ghc vs gcc vs jhc

2009-02-20 Thread Don Stewart
bulat.ziganshin:
 Hello John,
 
 Saturday, February 21, 2009, 3:42:24 AM, you wrote:
 
  this is true for *application* code, but for codec you may have lots of
  code that just compute, compute, compute
 
  Yes indeed. If there is code like this out there for haskell, I would
  love to add it as a test case for jhc.
 
 Crypto library has a lot of native haskell code computing hashes and
 encrypting data
 
 hopefully people will show other examples
 
 btw, Galois Cryptol has haskell backend, are you know? with jhс
 compilation it can probably generate as fast code as C backend does.
 it will be very interesting for us and even look as something close to
 production usage. i have crossposted message to Don

That's a very interesting idea. The output from Cryptol is self
contained enough, and simple, numerical code, that JHC probably could
handle it -- it doesn't require extensive libraries or runtime support,
for example. This warrents investigation.

Thanks for the suggestion!

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Don Stewart
bertram.felgenhauer:
 This is odd, but it doesn't hurt the inner loop, which only involves
 $wsum01_XPd, and is identical to $wfold_s15t above.
 
  Checking the asm:
  $ ghc -O2 -fasm
  
  sQ3_info:
  .LcRt:
cmpq 8(%rbp),%rsi
jg .LcRw
leaq 1(%rsi),%rax
addq %rsi,%rbx
movq %rax,%rsi
jmp sQ3_info
 
 So for some reason ghc ends up doing the (n + 1) addition before the
 (acc + n) addition in this case - this accounts for the extra
 instruction, because both n+1 and n need to be kept around for the
 duration of the addq (which does the acc + n addition).


Yep, well spotted.
  
  Checking via C:
  
 $ ghc -O2 -optc-O3 -fvia-C
  
  Better code, but still a bit slower:   
  
  sQ3_info:
cmpq8(%rbp), %rsi
jg  .L8
addq%rsi, %rbx
leaq1(%rsi), %rsi
jmp sQ3_info
 
 This code is identical (up to renaming registers and one offset that
 I can't fully explain, but is probably related to a slight difference
 in handling pointer tags between the two versions of the code) to the
 nice assembly above.


Indeed, which is gratifying.
  
  Running:
  
  $ time   ./B
  55
  ./B  1.01s user 0.01s system 97% cpu 1.035 total
 
 Hmm, about 5% slower, are you sure this isn't just noise?
 
 If not noise, it may be some alignment effect. Hard to say.


I couldn't get it under 1s from a dozen runs, so assuming some small
effect with alignment.

Why we get the extra test in the outer loop though, not sure. That's new
too I think -- at least I've not seen that pattern before.

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: garbage collector woes

2009-02-19 Thread Don Stewart
waterson:
 On Feb 17, 2009, at 12:22 PM, Chris Waterson wrote:

 I'm at wits end with respect to GHC's garbage collector and would very
 much appreciate a code review of my MySQL driver for HDBC, which is
 here:

  
 http://www.maubi.net/~waterson/REPO/HDBC-mysql/Database/HDBC/MySQL/Connection.hsc
  
 

 In particular, the problem that I'm having is that my statements
 (really, just iterators over a SQL query result set) are getting
 garbage collected prematurely.

 So (*blush*), my woes turned out to be my misunderstanding of the MySQL C 
 API, which
 I have now come to terms with.  I apologize for the noise here.

Is the solution written up somewhere so we can point to that next time?
:)
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] How to create an online poll

2009-02-18 Thread Don Stewart
This looks very promising!
Investigating...

anton:
 There's also the Condorcet Internet Voting Service:

   http://www.cs.cornell.edu/andru/civs.html


 gregg reynolds wrote:
 See also www.surveymonkey.com

 Bulat Ziganshin bulat.zigans...@gmail.com wrote:

 Hello haskell-cafe,

 http://zohopolls.com/

 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Polymorphism overhead

2009-02-17 Thread Don Stewart
wasserman.louis:
 I have (roughly) the following code:
 
 data Foo e
 type MFoo e = Maybe (Foo e)
 
 instance Ord e = Monoid (Foo e) where
 f1 `mappend` f2 = code invoking the mappend instance from Maybe (Foo e)
 
 I'd expect this to optimize to the same thing as if I had implemented:
 meld :: Ord e = Foo e - Foo e - Foo e
 f1 `meld` f2 = -- code invoking meld'
 
 meld' :: Ord e = Maybe (Foo e) - Maybe (Foo e) - Maybe (Foo e)
 meld' (Just f1) (Just f2) = meld f1 f2
 meld' m1 Nothing = m1
 meld' Nothing m2 = m2
 
 instance Ord e = Monoid (Foo e) where
  mappend = meld
 
 However, GHC's Core output tells me that the first piece of code reexamines 
 the
 polymorphism in every recursion, so that mappend, which is used in the Monoid
 instance of Foo, looks up the Monoid instance of Foo again (for the sole
 purpose of looking itself up) and recurses with that.  Why is this, and is
 there a way to fix that?
 

In general, INLINE or SPECIALIZE

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Arch Haskell News: Feb 16 2009

2009-02-16 Thread Don Stewart

Arch now has 926 Haskell packages in AUR.

That’s an increase of 27 new packages in the last 8 days, or 3.38 new
Haskell apps a day.

This weekly news includes:

* Noteworthy updates: grapefruit, haskelldb, gtk2hs
* A video on how to use Arch packages
* Updated releases by category

Read it all:

http://archhaskell.wordpress.com/2009/02/16/arch-haskell-news-feb-16-2009/

Enjoy!

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] ANN : Crypto 4.2.0 Related News

2009-02-16 Thread Don Stewart
wchogg:
 Hello Haskellers,
 
 I'm pleased to announce version 4.2.0 of Crypto has been uploaded to
 Hackage  that I am taking over maintenance of the library from
 Dominic Steinitz.  As of this release it should be cabal install'able
 on GHC 6.10.1.  I'm also pleased to announce that the darcs repo will
 be moving from code.haskell.org to being hosted on Patch-Tag at
 http://patch-tag.com/repo/crypto/home.  You don't need to sign up for
 Patch-Tag to use the read only repos, but you will need an account if
 you want to be given write access to the crypto repository.
 
 Please feel free to e-mail me with any issues or questions.

Great! Good to see the torch passed on.

Packaged up for Arch,

http://aur.archlinux.org/packages.php?ID=17492

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Memory

2009-02-16 Thread Don Stewart
inbuninbu:
 Hello All,
 
 The kind people at #haskell suggested I come to haskell-cafe for
 questions about haskell performance issues.
 I'm new to haskell, and I'm having a hard time understanding how to
 deal with memory leaks.
 
 I've been playing with some network server examples and I noticed with
 each new connection, the memory footprint increases by about 7k
 However, the leaks don't seem to have anything to do with the
 networking code. Actually I get a huge leak just from using using
 'forever'.
 
  import Control.Monad
  import System.IO
 
  main = forever $ putStrLn hi
 
 When I run it for a few seconds with profiling...
 
  total time  =0.36 secs   (18 ticks @ 20 ms)
  total alloc =  54,423,396 bytes  (excludes profiling overheads)
 
 Can this be right?


did you compile with optimisations on?

$ ghc -O2 A.hs --make
$ time ./A +RTS -sstderr

  17,880 bytes maximum residency (1 sample(s))
  18,984 bytes maximum slop
   1 MB total memory in use (0 MB lost due to fragmentation)

  Generation 0:  9951 collections, 0 parallel,  0.07s,  0.07s elapsed
  Generation 1: 1 collections, 0 parallel,  0.00s,  0.00s elapsed

  INIT  time0.00s  (  0.00s elapsed)
  MUT   time4.45s  ( 16.08s elapsed)
  GCtime0.07s  (  0.07s elapsed)
  EXIT  time0.00s  (  0.00s elapsed)
  Total time4.52s  ( 16.16s elapsed)

  %GC time   1.5%  (0.5% elapsed)

  Alloc rate1,173,414,505 bytes per MUT second

  Productivity  98.5% of total user, 27.5% of total elapsed

./A +RTS -sstderr  4.52s user 10.61s system 93% cpu 16.161 total

So it's allocating small cells, frequently, then discarding them -- and running 
in constant space.

Looking further,

forever :: (Monad m) = m a - m b
forever a   = a  forever a

Well, here, the result is thrown away anyway. And the result is (), so I'd 
expect 
constant space. 

Looks good to me. Did you run it without optimisations, on , perhaps?


-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Epic failure

2009-02-15 Thread Don Stewart
 OK, what did I do wrong here?

When making a request for help on a compiler issue, you failed to include key
information to make it possible to reproduce your problem, and what you did
include was broken or incorrect.

The three programs that submitted don't do even do the same thing.

Let's look into this further.

* Program 1:

   module Main () where

   import Data.List

top = 10 ^ 8 :: Int

main = do
 let numbers = [1 .. top]
 print $ foldl' (+) 0 numbers

-- Runtime is 20 seconds.

Well, let's see if we can reproduce this:

$ ghc -O2 A.hs --make
[1 of 1] Compiling Main ( A.hs, A.o )
Linking A ...

$ time ./A
50005000
./A  1.54s user 0.01s system 98% cpu 1.571 total

Nope. OK, so this seems like user error. Without more info about how you
conducted your experiment, the results are meaningless.

My guess is that you compiled it without optimisations?
Nope, not that,

$ ghc -O0 --make A.hs
$ time ./A
50005000
./A  2.65s user 0.01s system 99% cpu 2.667 tota

So even with all optimisations disabled, it is still an order of magnitude
faster than the number you presented. Resolution: invalid. Not reproducible.


* Program 2

   #include stdio.h

   int main(void)
{
 int total = 0;
 int n;

 for (n = 1, n  1; n++)
 total += n;

 printf(%d, n);
}

  // Runtime is 0.8 seconds.

Ok. Let's try this then, a C program:

$ gcc t.c 
t.c: In function ‘main’:
t.c:8: error: expected ‘;’ before ‘)’ token

Ah, an incorrect C program. Correcting the OP's typo:

$ time ./a.out
1
./a.out  0.41s user 0.00s system 100% cpu 0.416 total

So its actually a different program. Is this supposed to print 'total'?
This program seems wrong in a number of other ways too.

Resolution: non-sequitor


 Program 3

module Main () where

import Data.List

top = 10 ^ 8 :: Int

kernel i o = if i  top then o `seq` kernel (i+1) (o+i) else o

main = do
 print $ kernel 1 0

   -- Runtime is 0.5 seconds.
   Clearly these two nearly identical Haskell programs should have exactly
   the same runtime. Instead, one is 40x slower. Clearly something has gone
   catastrophically wrong here. The whole point of GHC's extensive optimiser
   passes are to turn the first example into the second example - but
   something somewhere hasn't worked. Any suggestions?


Ok, another program. Let's try this.

$ ghc -O2 B.hs --make
[1 of 1] Compiling Main ( B.hs, B.o )
Linking B ...

$ time ./B
49995000
./B  0.18s user 0.00s system 98% cpu 0.186 total

Oh, this is produces yet another result. In 0.186 seconds.


So, going back to the original question, what did you do wrong?

If you're seeking input for a technical error relating to performance, you
should have, but failed to:

* Use programs that implement the same algorithm
* Indicate which compiler versions/optimisations/architecture you're on
* State what you expected the results to be.

Besides the technical aspects, your presentation categorises the post somwhere 
between internet
crank and internet troll, as:

* You used an inflammatory title, which doesn't inspire trust.

* You jumped to conclusions on the fundamental nature of a technology,
  striking at its reasons for existing, without considering to recheck your
  assumptions.
 
So yes, epic fail. And after three years of this, I'm not hopeful.
But perhaps you can take some lessons from this post to improve your next one?




Now, assuming good faith, and you were just very confused about what you were
measuring, or how to measure it, or how to ask for help in a technical forum,
here's some more fun: let's write your 1st program, and see if GHC can
transform it into your 3rd program.

$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 6.10.1

$ uname -msr
Linux 2.6.28-ARCH x86_64

$ gcc --version
gcc (GCC) 4.3.3

$ ghc-pkg list uvector
uvector-0.1.0.3

Here's a a program written with combinators in a high level style (and using a
library written in a high level way):

import Data.Array.Vector
main = print . sumU . enumFromToU 0 $ (10^8 :: Int)

Compiling it,

$ ghc -O2 --make C.hs

Which yields the following core,

$wfold_s15D :: Int# - Int# - Int#
$wfold_s15D =
  \ (ww1_s15a :: Int#) (ww2_s15e :: Int#) -
case # ww2_s15e ww_s154 of wild_a12I {
  False -
$wfold_s15D
  (+# ww1_s15a ww2_s15e) (+# ww2_s15e 1);
  True - ww1_s15a

Because GHC knows how to optimise loops of these forms.

And the resulting assembly is pretty nice,

s16o_info:
  .Lc17g:
  cmpq 6(%rbx),%rdi
  jg 

Re: [Haskell-cafe] HaskellDB is alive?

2009-02-14 Thread Don Stewart
felipe.lessa:
 Hello!
 
 There was a new HaskellDB release, but I didn't see any announcement
 here. Is it back alive? What happened to 0.11?
 
 Thanks =)

http://hackage.haskell.org/cgi-bin/hackage-scripts/package/haskelldb-0.12
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Graph library, was: Haskell.org GSoC

2009-02-14 Thread Don Stewart
g9ks157k:
 Am Samstag, 14. Februar 2009 16:59 schrieb Brent Yorgey:
  On Thu, Feb 12, 2009 at 04:10:21PM +0100, Wolfgang Jeltsch wrote:
   Am Donnerstag, 12. Februar 2009 15:34 schrieb Thomas DuBuisson:
Get a community.haskell.org account once you are ready to start a
repo, it can not only host your repo (ex:
http://community.haskell.org/~tommd/pureMD5) but also allows you to
upload packages to hackage.haskell.org.
  
   I already have a Hackage account. Can this be readily used as a
   community.haskell.org account? If not, what if I get a community account.
   Do I have two accounts for Hackage access then?
 
  No, they are two separate things.  A Hackage account just lets you
  upload things to Hackage.  A community.haskell.org account lets you
  log into code.haskell.org (a completely different server than
  Hackage), host projects there, and so on.
 
 But Thomas DuBuisson wrote that you can upload packages to HackageDB with 
 your 
 community.haskell.org account (see above). Is this wrong?

Yes. Register for community accounts (shell, trac, darcs etc)

http://community.haskell.org/

(or you can use github if all you need is a repo).

To get hackage upload perms,

http://hackage.haskell.org/packages/accounts.html

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] ANNOUNCE: haha-0.1 - Animated ascii lambda

2009-02-14 Thread Don Stewart
sfvisser:
 Always wanted to have an full-color rotating vector based ascii art
 lambda on your terminal? This is your chance, installing `haha' will do
 the trick!

 This is very minimal vector based ascii art library written just for
 fun. There is a sample program called `rotating-lambda' which does
 exactly what is says.

 Make sure your terminal window is at least 80x40 and supports the most
 basic ANSI escape sequences before trying the demo.

Very smoothly done!

Here's a video of what he's talking about,

http://www.youtube.com/watch?v=MugQXHUZPK8 

Raw video,

http://galois.com/~dons/images/rotating-lambda.ogv

-- Don

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Haskell.org GSoC

2009-02-12 Thread Don Stewart
g9ks157k:
 Am Mittwoch, 11. Februar 2009 18:51 schrieb Don Stewart:
  For example, if all the haddocks on hackage.org were a wiki, and
  interlinked, every single package author would benefit, as would all
  users.
 
 You mean, everyone should be able to mess about with my documentation? This 
 would be similar to give everyone commit rights to my repositories or allow 
 everyone to edit the code of my published libraries. What is the good thing 
 about that?

No one said anything about unrestricted commit rights ... we're not
crazy ... what if it were more like, say, RWH's wiki .. where comments
go to editors to encorporate ...

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: [Haskell] Google Summer of Code 2009

2009-02-12 Thread Don Stewart
Malcolm.Wallace:
 Gwern Branwen gwe...@gmail.com wrote:
 
  * A GUI interface to Darcs
  (http://hackage.haskell.org/trac/summer-of-code/ticket/17);
 
 I wonder whether darcs ought to apply to be a GSoC mentoring
 organisation in its own right this year?  It would be good to attempt to
 get a couple of dedicated slots for darcs only (in addition to any that
 haskell.org may get).
 
  * Optimization of containers
  (http://hackage.haskell.org/trac/summer-of-code/ticket/1549). Would
  benefit every Haskell user very quickly.
 
 This was Jamie Brandon's GSoC project last year, and although that is
 not yet in wide use, I suspect there is very little extra effort needed
 to get it out there into the average Haskell user's hands.
 
  * XMonad compositing support
  (http://hackage.haskell.org/trac/summer-of-code/ticket/1548).
 
 Maybe XMonad should also think about whether to apply to GSoC in their
 own right as a mentoring org?  As a project, it seems to have a lot of
 life independent of the Haskell community.

I agree: the big projects can stand on their own.

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: [Haskell] Google Summer of Code 2009

2009-02-12 Thread Don Stewart
gtener:
 On Thu, Feb 12, 2009 at 11:36, Malcolm Wallace
 malcolm.wall...@cs.york.ac.uk wrote:
  Gwern Branwen gwe...@gmail.com wrote:
 
  * A GUI interface to Darcs
  (http://hackage.haskell.org/trac/summer-of-code/ticket/17);
 
  I wonder whether darcs ought to apply to be a GSoC mentoring
  organisation in its own right this year?  It would be good to attempt to
  get a couple of dedicated slots for darcs only (in addition to any that
  haskell.org may get).
 
  * Optimization of containers
  (http://hackage.haskell.org/trac/summer-of-code/ticket/1549). Would
  benefit every Haskell user very quickly.
 
  This was Jamie Brandon's GSoC project last year, and although that is
  not yet in wide use, I suspect there is very little extra effort needed
  to get it out there into the average Haskell user's hands.
 
  * XMonad compositing support
  (http://hackage.haskell.org/trac/summer-of-code/ticket/1548).
 
  Maybe XMonad should also think about whether to apply to GSoC in their
  own right as a mentoring org?  As a project, it seems to have a lot of
  life independent of the Haskell community.
 
 
 By the way: I think it may be worthwile to contact Google to point out
 the recent growth of Haskell community. I don't know on what basis
 they assign the slots, but it may be beneficial to do so.

In the past it has been based on scale of mentors, proposals and
students. If we're under-allocated, that can sometimes be addressed, however.

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: Google Summer of Code 2009

2009-02-12 Thread Don Stewart
gwern0:
 On Thu, Feb 12, 2009 at 11:49 AM, John Lato jwl...@gmail.com wrote:
  Johan Tibell wrote:
  On Thu, Feb 12, 2009 at 2:12 AM, Felipe Lessa felipe.le...@gmail.com 
  wrote:
  Do we already have enough information to turn
  http://okmij.org/ftp/Haskell/Iteratee/ into a nice, generic, cabalized
  package? I think Iteratees may prove themselves as useful as
  ByteStrings.
 
  I still haven't figured out what the correct definition of Iteratee
  would look like. The Iteratee code that Oleg wrote seems to have the
  structure of some kind of two level monad. I think that's the reason
  for the frequent occurrences of == and liftI in the code. There
  seems to be some things we yet have to discover about Iteratees.
 
 
  I concur.  I've recently been involved with several discussions on
  this topic, and there are some issues that remain.  The two level
  monad part doesn't bother me, but I think the type should be slightly
  more abstract and I'm not sure of the best way to do so.  IMO liftI is
  used more because of Oleg's particular style of coding than anything
  else.  I don't think it need be common in user code, although it may
  be more efficient.
 
  I think that, if a GSOC project were to focus on Iteratees, it would
  need to look at issues like these.  I can't judge as to whether this
  is an appropriate amount of work for GSOC, however simply packaging
  and cabal-izing Oleg's Iteratee work (or Johan's, or my own) is likely
  of too small a scope.
 
  John Lato
 
 I agree. Just packaging and cabalizing something is likely not a
 SoC-worthy project. (This is why the 'cabalize Wash' suggestion will
 never make it, for example.) In general, cabalizing seems to be either
 pretty easy (most everything I've cabalized) or next to impossible
 (gtk2hs, ghc). The former are too trivial for SoC, and the latter
 likely are impossible without more development of Cabal - at which
 point it'd be more correct to call it a Cabal SoC and not a cabalizing
 SoC.

Yes, cabalising was more of a priority when we only had 10 libraries :)

So in general, think hard about missing capabilities in Haskell:

* tools
* libraries
* infrastructure

that benefit the broadest number of Haskell users or developers.

Another route is to identify a clear niche where Haskell could leap
ahead of the competition, with a small investment.

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Is using Data.Dynamic considered a no-go?

2009-02-12 Thread Don Stewart
bugfact:
 Haskell seems to have pretty strong support for dynamic casting using
 Data.Typeable and Data.Dynamic.
 
 All kinds of funky dynamic programming seems to be possible with these
 hacks. 
 
 Is this considered as being as bad as - say - unsafePerformIO? What kind of
 evil is lurking here?

Inefficiencies and runtime errors?

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Is using Data.Dynamic considered a no-go?

2009-02-12 Thread Don Stewart
Notably, extensible exceptions use dynamics, in conjunction with type
classes and existentials.

A number of solutions to the 'expression problem' involve dynamics.

bugfact:
 It would be interesting to see when you HAVE to use dynamics, e.g. when no
 other solution is possible in Haskell...
 
 Right now if I use it, it feels that I'm doing so because I'm too new to
 Haskell.
 
 
 On Thu, Feb 12, 2009 at 7:53 PM, Lennart Augustsson lenn...@augustsson.net
 wrote:
 
 You're quite right.  You should only be allowed to derive Typeable.
 (Which could be arranged by hiding the methods of typeable.)
 
 On Thu, Feb 12, 2009 at 6:24 PM, Jonathan Cast
 jonathancc...@fastmail.fm wrote:
  On Thu, 2009-02-12 at 19:04 +0100, Lennart Augustsson wrote:
  They are not unsafe in the way unsafePerformIO is,
 
  I beg permission to demur:
 
   newtype Unsafe alpha = Unsafe { unUnsafe :: alpha }
   instance Typeable (Unsafe alpha) where
 typeOf _ = typeOf ()
 
   pseudoSafeCoerce :: alpha - Maybe beta
   pseudoSafeCoerce = fmap unUnsafe . cast . Unsafe
 
  Note that
 
   pseudoSafeCoerce = Just . unsafeCoerce
 
  but I regard them
  as a last resort in certain situations.
  Still, in those situations they are very useful.
 
  But I would agree with both of these.  As long as you *derive* Typeable.
 
  jcc
 
 
  ___
  Haskell-Cafe mailing list
  Haskell-Cafe@haskell.org
  http://www.haskell.org/mailman/listinfo/haskell-cafe
 
 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe
 
 

 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Race condition possible?

2009-02-12 Thread Don Stewart
bugfact:
 Consider the following code
 
 stamp v x = do
   t - getCurrentTime 
   putMVar v (x,t)
 
 Is it possible - with GHC - that a thread switch happens after the t -
 getCurrentTime and the putMVar v (x,t)? 

Yes. if 't' is heap allocated, there could be a context switch.
  
 If so, how would it be possible to make sure that the operation of reading the
 current time and writing the pair to the MVar is an atomic operation, in the
 sense that no thread switch can happen between the two? Would this require 
 STM?
 

Using 'atomically' and TVars in STM, perhaps? Else, use withMVar?   Or a
modifyMVar in IO?

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: [Haskell] Google Summer of Code 2009

2009-02-11 Thread Don Stewart
gwern0:
 (The following is a quasi essay/list of past Summer of Code projects;
 my hope is to guide thinking about what Summer of Code projects would
 be good to pick, and more specifically what should be avoided.
 If you're in a hurry, my conclusions are at the bottom.
 The whole thing is written in Markdown; for best results pass it
 through Pandoc or view it via your friendly local Gitit wiki.)
 

Thanks for the write up!

We explicitly pushed harder in 2008 to clarify and simplify the goals of
the projects, ensure adequate *prior Haskell experience* and to 
focus on libraries and tools that directly benefit the communtity.

And our success rate was much higher.

So: look for things that benefit the largest number of Haskell
developers and users, and from students with proven Haskell development
experience. You can't learn Haskell from zero on the job, during SoC.

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: [Haskell] Google Summer of Code 2009

2009-02-11 Thread Don Stewart
bulat.ziganshin:
 Hello Jamie,
 
 Wednesday, February 11, 2009, 5:54:09 AM, you wrote:
 
  Seems like it is ok to write H.264 in Haskell and released via GPL
  license?
 
 anyway it's impossible due to slow code generated by ghc
 

Been a long time since you did high perf code -- we routinely now write
code that previously was considered not feasible.

However, I would say it needs an optimisation expert, yes, in any
language.

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Haskell.org GSoC

2009-02-11 Thread Don Stewart
d:
 Hi,

 I noticed last year Haskell.org was a mentoring organization for  
 Google's Summer of Code, and I barely noticed some discussion about it  
 applying again this year :)

 I participated for GCC in 2008 and would like to try again this year;  
 while I'm still active for GCC and will surely stay so, I'd like to see  
 something new at least for GSoC.  And Haskell.org would surely be a  
 very, very nice organization.

 Since I discovered there's more than just a lot of imperative languages  
 that are nearly all the same, I love to do some programming in Prolog,  
 Scheme and of course Haskell.  However, so far this was only some toy  
 programs and nothing really useful; I'd like to change this (as well  
 as learning more about Haskell during the projects).

 Here are some ideas for developing Haskell packages (that would  
 hopefully be of general use to the community) as possible projects:

 - Numerics, like basic linear algebra routines, numeric integration and  
 other basic algorithms of numeric mathematics.

I think a lot of the numerics stuff is now covered by libraries (see
e.g. haskell-blas, haskell-lapack, haskell-fftw)
 
 - A basic symbolic maths package; I've no idea how far one could do this  
 as a single GSoC project, but it would surely be a very interesting  
 task.  Alternatively or in combination, one could try to use an existing  
 free CAS package as engine.

Interesting, but niche, imo.
 
 - Graphs.

 - Some simulation routines from physics, though I've not really an idea  
 what exactly one should implement here best.

True graphs (the data structure) are still a weak point! There's no
canonical graph library for Haskell. 
 

 - A logic programming framework.  I know there's something like that for  
 Scheme; in my experience, there are some problems best expressed  
 logically with Prolog-style backtracking/predicates and unification.  
 This could help use such formulations from inside a Haskell program.  
 This is surely also a very interesting project.

Interesting, lots of related work, hard to state the benefits to the
community though.
 
 What do you think about these ideas?  I'm pretty sure there are already  
 some of those implemented, but I also hope some would be new and really  
 of some use to the community.  Do you think something would be  
 especially nice to have and is currently missing?

Think about how many people would benefit.

For example, if all the haddocks on hackage.org were a wiki, and
interlinked, every single package author would benefit, as would all
users. 

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] GHC development

2009-02-11 Thread Don Stewart
andrewcoppin:
 OK, so I have a small question.

 I was just wondering what the current state of development with GHC is.  
 So, I had a look at the developer wiki. Unfortunately, as best as I can  
 tell, most of the status pages haven't been updated in many months.  
 (Most of them still talk about what will or won't be in 6.10.1, which  
 has been *released* for a while now.) What's the best way to find out  
 what the real state of affairs is? What are the developers really  
 working on? What's on hold? How far have people got with things? Etc.

 (Yes, I know. I'm nosey...)


GHC questions should go to glasgow-haskell-users,


http://www.haskell.org/pipermail/glasgow-haskell-users/2009-February/thread.html

To really see what is going on, look at the commit list and the bug
tracker,

http://www.haskell.org/pipermail/cvs-ghc/2009-February/thread.html

Bug tracker,


http://hackage.haskell.org/trac/ghc/query?status=newstatus=assignedstatus=reopenedgroup=prioritytype=bugorder=iddesc=1

These links are trivial to find from the GHC home page. 

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: [Haskell] Google Summer of Code 2009

2009-02-11 Thread Don Stewart
bulat.ziganshin:
 Hello Don,
 
 Wednesday, February 11, 2009, 8:28:33 PM, you wrote:
 
  anyway it's impossible due to slow code generated by ghc
 
  Been a long time since you did high perf code -- we routinely now write
  code that previously was considered not feasible.
 
 which is still slower than C and need more time to write
 
  However, I would say it needs an optimisation expert, yes, in any
  language.
 
 there are experts, includingyou, in making haskell specific code as
 fast as possible, but i don't know anyone using haskell to write
 high-performance code. so you ask for non-existing specialists

We're doing it at Galois regularly. Check out the blog.

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re[4]: [Haskell] Google Summer of Code

2009-02-11 Thread Don Stewart
bulat.ziganshin:
 Hello John,
 
 Wednesday, February 11, 2009, 11:55:47 PM, you wrote:
 
  it's exactly example of tight loop. and let's compare HP code written
  for this task with analogous code written in C. i expect that haskell
  code is much more complex
 
  I think it's fair to point out that tight loops are nearly always the
  biggest bottlenecks of code, so generating good code for tight loops
  is pretty important.
 
 it's important, but doesnt't make whole game. and while i said that
 ghc improved tight loops compilation, this doesn't mean that it
 becomes the same as in gcc. it just started to put loop variables into
 register
 
  And ghc is still making large improvements with
  each release, whereas gcc isn't likely to get significantly better.
 
 yes, it's close to perfect
 
  afaiu, it's 20-line equivalent of 2-line C code:
 
  for (i=...)
   a[i] = b[i]
 
  does this need any more comments?
 
  I think you've misunderstood my code.  Look at Oleg's IterateeM and
  see if you think that's really all it's doing.
 
 what else does the code that you've citated? you are wrote that it
 just copies 16-bit words into doubles
 
  Use libsndfile for comparison.  http://www.mega-nerd.com/libsndfile/.
 
 it's one method of miscomparing haskell to C - compare hand-tuned
 haskell code with some C code which may be just not optimal. ig you
 want to make fair comparison, you should write best code in both
 languages
 
  I actually haven't looked at the code, although it's very highly
  regarded in the audio community (and I've seen the author post on this
  list on occasion).  Using libsndfile-1.0.18:
   wc wav.c
  17867833   57922 wav.c
 
  compared to my source:
  wc Wave.hs
   4122215   15472 Wave.hs
 
  And there you are.  I will admit that I have implemented the entire
  wave spec, but only because of lack of time.
 
 when you don't need speed, you may write more compact code in haskell
 than in C. so the best way is to split your task into
 speed-critical part and the rest and use C++ for the first and Haskell
 for the second


I think what's frustrating about this continued dialogue with Bulat re.
performance is that ,

a) the experience he bases his remarks upon was several year ago
b) he's making blanket generic statements, using that old data
d) a lot of people have written a lot of fast code without trouble
c) he's not acknowledging the great improvements over this time

So its very difficult to have these conversations. They're stuck in the
same old pattern.

Meanwhile, GHC keeps getting smarter and smarter. 

Bulat: time to update your results! 

Check out what GHC is doing these days, and come back with an analysis
of what still needs to be improved.  We can't wait to hear!

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: [Haskell] Google Summer of Code 2009

2009-02-11 Thread Don Stewart
Thanks for the analysis, this clarifies things greatly.
Feasibility and scope is a big part of how we determine what projects to
work on.

gtener:
 On Wed, Feb 11, 2009 at 21:00, Jamie hask...@datakids.org wrote:
  Hi Gwern,
 
  On Wed, 11 Feb 2009, Gwern Branwen wrote:
 
  I just checked H.263 and it looks like it does not require patent
  licensing
  at all (it is created by ITU-T Video Coding Experts Group (VCEG)) so one
  can
  write H.263 in Haskell and release freely without patent licensing
  issues.
 
  So writing H.263 in Haskell could be a good GSoC project.  One mentioned
  that GHC produce slow code, well H.263 could be a good test case to
  improve
  GHC optimization over time.  In The Computer Language Benchmarks Game,
  Haskell has some catching up to do. :)
 
  It does sound like a reasonably discrete task, and it sounds like you have
  a use for it; but I wonder if it's doable in a single summer?
 
  I have no idea, I have not dig deeper into H.263 C source code but I guess
  it should be quite trivial as it is a black box with video frame input and
  output with several parameters for encoding and just frame in/out for
  decoding.
 
 I didn't dig into the source code either, but I've just skimmed
 through Wikipedia page on that codec:
 http://en.wikipedia.org/wiki/H.263
 and in seems far from trivial. Anything that has 23 annexes is likely
 to be quite complex :-)
 Therefore I seriously doubt chances for success of such project. I did
 some checks: in libavcodec at least following files consist of
 implementation of H.263:
 
 h263.c h263data.h h263dec.c  h263.h
 h263_parser.c  h263_parser.h
 
 How many lines are there?
 
 [te...@laptener libavcodec]$ wc h263*
   6295  19280 218932 h263.c
314   2117  10423 h263data.h
816   2171  26675 h263dec.c
 46217   2032 h263.h
 91282   2361 h263_parser.c
 29165   1047 h263_parser.h
   7591  24232 261470 razem
 
 In Haskell project one would also need to provide some additional
 utility code which is part of libavcodec.
 Fast grep shows the tip of an iceberg:
 
 [te...@laptener libavcodec]$ grep include h263* | grep -v 
 h263.c:#include dsputil.h
 h263.c:#include avcodec.h
 h263.c:#include mpegvideo.h
 h263.c:#include h263data.h
 h263.c:#include mpeg4data.h
 h263.c:#include mathops.h
 h263data.h:#include mpegvideo.h
 h263dec.c:#include avcodec.h
 h263dec.c:#include dsputil.h
 h263dec.c:#include mpegvideo.h
 h263dec.c:#include h263_parser.h
 h263dec.c:#include mpeg4video_parser.h
 h263dec.c:#include msmpeg4.h
 h263.h:#include config.h
 h263.h:#include msmpeg4.h
 h263_parser.c:#include parser.h
 h263_parser.h:#include parser.h
 
 
 
 Bottom line: I don't think it is reasonable to assume anyone without
 previous knowledge of H.263 is able to fit that project into one
 summer. But! It's Haskell community, and people here see the
 impossible happen from time to time ;-)
 
 All best
 
 Christopher Skrzętnicki
 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe
 
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re[4]: [Haskell] Google Summer of Code

2009-02-11 Thread Don Stewart
bulat.ziganshin:
 Hello Don,
 
 Thursday, February 12, 2009, 12:23:16 AM, you wrote:
 
  Check out what GHC is doing these days, and come back with an analysis
  of what still needs to be improved.  We can't wait to hear!
 
 can you point me to any haskell code that is as fast as it's C
 equivalent?

You should do your own benchmarking!

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Re: [Haskell] Google Summer of Code 2009

2009-02-10 Thread Don Stewart
Malcolm.Wallace:
 Gentle Haskellers,
 
 The Google Summer of Code will be running again this year.  Once again,
 haskell.org has the opportunity to bid to become a mentoring
 organisation.  (Although, as always, there is no guarantee of
 acceptance.)
 
 If you have ideas for student projects that you think would benefit the
 Haskell community, now is the time to start discussing them on mailing
 lists of your choice.  We especially encourage students to communicate
 with the wider community: if you keep your ideas private, you have a
 much worse chance of acceptance than if you develop ideas in
 collaboration with those who will be your customers, end-users, or
 fellow-developers.  This is the open-source world!
 

And I'll just note that since December we've been running a proposal
submission site here, where you can vote and comment on ideas,

http://www.reddit.com/r/haskell_proposals/top/

A great place to suggest ideas!

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Asking the GHC garbage collector to run

2009-02-10 Thread Don Stewart
mads_lindstroem:
 Hi all,
 
 Is it possible to ask the GHC garbage collector to run ? Something like
 a collectAllGarbage :: IO() call.

System.Mem.performGC

iirc,
Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] GMP on Mac OS X linked statically by default

2009-02-10 Thread Don Stewart
leimy2k:
 Was there a reason for this?  If so, it'd be nice if the package that was 
 build
 explained why... otherwise it feels kind of arbitrary, and would be nice if
 there was documentation available to make it link dynamically in case someone
 didn't want to LGPL their program.
 
 Anyone know the steps to make it link dynamically?
 

Here's how we do it on Windows. The Mac should be far easier,

http://haskell.forkio.com/gmpwindows

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Gtk2HS 0.10.0 Released

2009-02-10 Thread Don Stewart
Well done!

Our flagship GUI bindings... Go team!

-- Don

pgavin:
 Hi everyone,

 Oh, dear... it seems I've forgotten how to spell cafe, and sent this  
 message to haskell-c...@haskell.org the first time around.  I resent it  
 to all the lists again (just to make sure everyone interested receives  
 it), so I apologize for any duplicated messages you might have received.  
  In any case...

 I'd like to release the announcement of Gtk2HS 0.10.0.  A lot of new  
 stuff has gone into this release, including:

 - Support for GHC 6.10
 - Bindings to GIO and GtkSourceView-2.0
 - Full switch to the new model-view implementation using a Haskell model
 - Support for many more model-based widgets such as IconView and an  
 updated binding for ComboBox
 - Full Drag-and-Drop support
 - Better support for Attributes in Pango
 - Replaced Event for EventM monad, thereby improving efficiency and  
 convenience
 - Functions for interaction between Cairo and Pixbuf drawing
 - Lots of bug fixes, code cleanups, and portability improvements

 With this release, the bindings to GnomeVFS and GtkSourceView-1.0 have  
 been deprecated.  The TreeList modules have been deprecated from the  
 Gtk+ bindings.

 Source and Win32 binaries are available at:


 https://sourceforge.net/project/showfiles.php?group_id=49207package_id=42440release_id=659598

 Thanks to everyone who submitted bug fixes and features this time around!

 Thanks,
 Peter Gavin
 Gtk2HS Release Manager

 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Efficient string output

2009-02-09 Thread Don Stewart
ketil:
 
 Hi,
 
 I'm currently working on a program that parses a large binary file and
 produces various textual outputs extracted from it.  Simple enough.
 
 But: since we're talking large amounts of data, I'd like to have
 reasonable performance.  
 
 Reading the binary file is very efficient thanks to Data.Binary.
 However, output is a different matter.  Currently, my code looks
 something like:
 
   summarize :: Foo - ByteString
   summarize f = let f1 = accessor f
 f2 = expression f
:
 in B.concat [f1,pack \t,pack (show f2),...]
 
 which isn't particularly elegant, and builds a temporary ByteString
 that usually only get passed to B.putStrLn.  I can suffer the
 inelegance were it only fast - but this ends up taking the better part
 of the execution time.

Why not use Data.Binary for output too? It is rather efficient at
output -- using a continuation-like system to fill buffers gradually.

--   Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: The Haskell re-branding exercise

2009-02-09 Thread Don Stewart
marlowsd:
 Sterling Clover wrote:
 IP based limitations are a terrible idea. Multiple users can be and  
 often are behind the same IP if they're in some sort of intranet, be it 
 corporate, academic, or simply multiple home computers. Mail-based  
 authentication can be screwed with, sure, but it's also very easy to  
 notice this (as opposed to ip nonsense) through simply eyeballing the  
 results. There's no general everywhere way to prevent vote fraud.  
 However, if we make it even require a mild bit of thought, that should  
 be sufficient in this case, as there won't be enough votes to prevent  
 some sort of rough eyeball-based check of the results, and if there 
 are, then that's a sign of fraud for sure! Furthermore, there's very 
 little incentive for someone to go the extra mile here, as we're voting 
 for a haskell logo, and not, e.g., giving away ten thousand dollars.  
 Furthermore, since I assume we'll only be presenting reasonable logos,  
 there's not even some room for pranksters to stage a write-in of some 
 gag slogan.

 I suggest we do voting by email, and restrict voting to those who have 
 ever posted on haskell-cafe before 1 Jan 2009.  We could then have an  
 auto-confirmation scheme similar to mailing list sign-up where the  
 confirmation message is sent back to the originator to confirm their  
 identity, containing a verification link to click on.

 I realise there are flaws in this, but it seems to be (a) cheap to  
 implement and participate in, and (b) good enough.

Seems good enough. Who's going to tally the votes?
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] any implementation of ACIO?

2009-02-08 Thread Don Stewart
jianzhou:
 Hi,
  
 http://www.haskell.org/pipermail/haskell-cafe/2004-November/007715.html
 mentioned an interesting (A)ffine and (C)entral IO. Are there any packages
 or extensions to support ACIO in Haskell?

Not that I know of. 

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] how to link statically with a c lib ?

2009-02-08 Thread Don Stewart
noteed:
 Hi,
 
 I'm writing bindings for the Tiny C Compiler.
 It seems that tcc provide a libtcc.a but no libtcc.so.
 
 In my cabal file, I have
 
   extra-libraries: dl, tcc
 
 but when using the generated haskell module,
 I have the following message :
 
   ⟨...@jones samples⟩ ghc -e main Test.hs
   interactive: command line: can't load .so/.DLL for: tcc
 (libtcc.so: cannot open shared object file: No such file or directory)
 
 How can I generate a module linked statically against libtcc ?

Without a .so you can't load it in ghci, but you can compile it with ghc.

 ghc --make Test.hs

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] how to link statically with a c lib ?

2009-02-08 Thread Don Stewart
noteed:
 2009/2/8 Don Stewart d...@galois.com:
  noteed:
  Hi,
 
  I'm writing bindings for the Tiny C Compiler.
  It seems that tcc provide a libtcc.a but no libtcc.so.
 
  In my cabal file, I have
 
extra-libraries: dl, tcc
 
  but when using the generated haskell module,
  I have the following message :
 
⟨...@jones samples⟩ ghc -e main Test.hs
interactive: command line: can't load .so/.DLL for: tcc
  (libtcc.so: cannot open shared object file: No such file or directory)
 
  How can I generate a module linked statically against libtcc ?
 
  Without a .so you can't load it in ghci, but you can compile it with ghc.
 
   ghc --make Test.hs
 
 Ok but what should be written in the cabal file ?
 
 I build a .so of libtcc so it works for now.
 
 Before I put it on hackage, maybe I can get a review of it, if
 anything is fundamentaly wrong ?
 It is located at http://github.com/noteed/tcc/tree/master

In the .cabal file should only be:

extra-libraries: tcc

I think.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] ANNOUNCE: X Haskell Bindings 0.1

2009-02-08 Thread Don Stewart
aslatter:
 I'd like to announce a version bump for the X Haskell Bindings (XHB)
 library, to 0.1.* from 0.0.*.
 
 The goal of XHB is to provide a Haskell implementation of the X11 wire
 protocol, similar in spirit to the X protocol C-language Binding
 (XCB).
 
 On Hackage: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/xhb
 
 This release focuses on making the API a bit friendlier:
 
  + 'type BOOL = Word8' has been replaced in the API by Prelude.Bool
 
  + type synonyms BYTE, CARD8, CARD16 and CARD32 for the Data.Word
 types have been eliminated
 
  + type synonyms INT8, INT16 and INT32 for the Data.Int types have
 been eliminated
 
  + Previously, all protocol replies were represented by their own
 distinct data type.  Now, if the reply to a request only includes a
 single field, the request returns that field directly.
 
  In more concrete terms:
 
  internAtom :: Connection - InternAtom - IO (Receipt InternAtomReply)
 
 becomes:
 
  internAtom :: Connection - InternAtom - IO (Receipt ATOM)
 
 Further work to make the API more Haskelly is ongoing.
 
 Related projects:
 
 X C Bindings: http://xcb.freedesktop.org/

Well done!

Have a distro package,

http://aur.archlinux.org/packages.php?ID=23765

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] The Haskell re-branding exercise

2009-02-08 Thread Don Stewart
s.clover:
 IP based limitations are a terrible idea. Multiple users can be and  
 often are behind the same IP if they're in some sort of intranet, be it 
 corporate, academic, or simply multiple home computers. Mail-based  
 authentication can be screwed with, sure, but it's also very easy to  
 notice this (as opposed to ip nonsense) through simply eyeballing the  
 results. There's no general everywhere way to prevent vote fraud.  
 However, if we make it even require a mild bit of thought, that should be 
 sufficient in this case, as there won't be enough votes to prevent some 
 sort of rough eyeball-based check of the results, and if there are, then 
 that's a sign of fraud for sure! Furthermore, there's very little 
 incentive for someone to go the extra mile here, as we're voting for a 
 haskell logo, and not, e.g., giving away ten thousand dollars. 

Exactly. Let's not wander down to the bikeshed :)

 Furthermore, since I assume we'll only be presenting reasonable logos, 
 there's not even some room for pranksters to stage a write-in of some 
 gag slogan.

Right, only a subset of previously submitted ones.

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] The Haskell re-branding exercise

2009-02-08 Thread Don Stewart
  Furthermore, since I assume we'll only be presenting reasonable logos,
  there's not even some room for pranksters to stage a write-in of some
  gag slogan.
 
  Right, only a subset of previously submitted ones.
 
  -- Don
 
 So does this mean no 'haskell YEEHH!'?

Isn't that already the underground official logo?

   http://www.facebook.com/pages/Haskell/56088385002

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] The Haskell re-branding exercise

2009-02-07 Thread Don Stewart
paul:
 Paul Johnson wrote:
 A call has gone out  
 http://www.haskell.org/pipermail/haskell-cafe/2008-December/051836.html 
 for a new logo for Haskell.  Candidates (including a couple  
 http://www.haskell.org/haskellwiki/Image:Haskell-logo-revolution.png  
 of mine  
 http://www.haskell.org/sitewiki/images/f/fd/Ouroborous-oval.png) are  
 accumulating here  
 http://www.haskell.org/haskellwiki/Haskell_logos/New_logo_ideas.   
 There has also been a long thread on the Haskell Cafe mailing list.

 So what's happening about this?


We need a voting site set up. There was some progress prior to the end
of the year. Updates welcome!

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] The Haskell re-branding exercise

2009-02-07 Thread Don Stewart
wagner.andrew:
 
 We need a voting site set up. There was some progress prior to the end
 of the year. Updates welcome!
 
 -- Don
 
 Can't we just use the haskell proposal reddit for this?
  
Hmm... not ideal. Would make a backup should all else fail.


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] The Haskell re-branding exercise

2009-02-07 Thread Don Stewart
Oh, we had a long discussion about the need for condorcet voting,
not a system like the reddit which is prone to abuse.

Also, it would be good to have the images inline.

wagner.andrew:
 Um, ok. Glad we could discuss it
 
 On Sat, Feb 7, 2009 at 1:12 PM, Don Stewart d...@galois.com wrote:
 
 wagner.andrew:
 
  We need a voting site set up. There was some progress prior to the
 end
  of the year. Updates welcome!
 
  -- Don
 
  Can't we just use the haskell proposal reddit for this?
 
 Hmm... not ideal. Would make a backup should all else fail.
 
 
 
 
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Semantic web

2009-02-07 Thread Don Stewart
dev:
 Anybody implementing rdf or owl  stuff in haskell?  Seems like a natural fit.

http://www.ninebynine.org/RDFNotes/Swish/Intro.html

Needs moving to Hackage.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] The Haskell re-branding exercise

2009-02-07 Thread Don Stewart
gwern0:
 On Sat, Feb 7, 2009 at 1:34 PM, Don Stewart d...@galois.com wrote:
 Oh, we had a long discussion about the need for condorcet voting,
 not a system like the reddit which is prone to abuse.
 
 Also, it would be good to have the images inline.
 
 Perfect, please meet better. Better, perfect. Now get along you two!
 
 Since January 1st, we could've had hundreds or thousands of votes and
 easily compensated for any abuse.

Unfortunately, reddit isn't a suitable voting site, as submissions decay
over time, dissappearing off the page after a day or two. It does have
up and down mods, but in no other way is a voting site.

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] The Haskell re-branding exercise

2009-02-07 Thread Don Stewart
gwern0:
 On Sat, Feb 7, 2009 at 3:04 PM, Don Stewart d...@galois.com wrote:
  gwern0:
  On Sat, Feb 7, 2009 at 1:34 PM, Don Stewart d...@galois.com wrote:
  Oh, we had a long discussion about the need for condorcet voting,
  not a system like the reddit which is prone to abuse.
  
  Also, it would be good to have the images inline.
 
  Perfect, please meet better. Better, perfect. Now get along you two!
 
  Since January 1st, we could've had hundreds or thousands of votes and
  easily compensated for any abuse.
 
  Unfortunately, reddit isn't a suitable voting site, as submissions decay
  over time, dissappearing off the page after a day or two. It does have
  up and down mods, but in no other way is a voting site.
 
  -- Don
 
 That's how the what's hot works, I understand. But it seems to me that
 Top works just fine for vote tallying purposes eg.
 http://www.reddit.com/r/haskell/top/ lists quite a few posts posted
 months ago (4 months seems to be the oldest).

Quite so, biased by the fact that they dropped off the page.

I'm not saying reddit is unsuitable for communal decision making -- I've
thought hard about this -- just that isn't perfect, and this isn't
really its purpose. It would make a good backup if we can't find a
proper system.

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] The Haskell re-branding exercise

2009-02-07 Thread Don Stewart
gwern0:
 2009/2/7 Don Stewart d...@galois.com:
  Quite so, biased by the fact that they dropped off the page.
 
  I'm not saying reddit is unsuitable for communal decision making -- I've
  thought hard about this -- just that isn't perfect, and this isn't
  really its purpose. It would make a good backup if we can't find a
  proper system.
 
  -- Don
 
 And how long do we wait? Is a month long enough? 2 months? Do we just
 make a note on our calendars for February 2010 - 'get moving on that
 logo contest thing'?

Help identifying and implementing a voting process is very welcome.
Snarky comments are not.

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] The Haskell re-branding exercise

2009-02-07 Thread Don Stewart
bulat.ziganshin:
 Hello Don,
 
 Saturday, February 7, 2009, 8:20:23 PM, you wrote:
 
  We need a voting site set up. There was some progress prior to the end
  of the year. Updates welcome!
 
 i think that there are a lot of free voting/survey services available.
 the last one i went through was LimeSurvey available for any SF
 project and on separate site too
 
 http://apps.sourceforge.net/trac/sitedocs/wiki/Hosted%20Apps
 https://www.limeservice.com/
 

Before the new year's break, the progress we made towards deciding on a
voting process was,

http://groups.google.com/group/fa.haskell/msg/5d0ad1a681b044c7

Eelco implemented a demo condorcet voting system in HAppS.

He then asked for help with some decisions:

* Limit voting, if so how?  Email confirmation, IP based, vote once,  once 
per day? 
* Maybe don't show the results until the contest is over? 

Eelco, can we do simple email-based confirm to encourage people to vote
only once, and can we keep the results closed until the vote process is
over?

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Are you using Haskell on the job?

2009-02-06 Thread Don Stewart
kirk.martinez:
 Hello, fellow Haskell hackers!  I am writing a term paper on Haskell in
 Business, and while I have gathered a lot of good information on the Internet,
 I would really like direct feedback from software professionals who have used
 Haskell in a business setting.  I would really appreciate a few minutes of 
 your
 time to provide insights gained from applying Haskell in the real world.  Who
 knows, this could lead to a greater adoption of Haskell in the business
 community!
 
  
 
 Rather than a list of Haskell's technical strengths (purity, laziness,
 composition, etc.), I want to get a sense of the process leading up to the
 decision to use Haskell for a given project and the insights gained during and
 after completion.  I am particularly interested in questions related to
 business value:
 
  
 
   ● What were the pros and cons you considered when choosing a language?  Why
 FP?  Why Haskell?
   ● What aspects of your problem domain were most critical to making that
 choice?
   ● How has using Haskell given you a competitive advantage?
   ● How is the software development lifecycle positively/negatively affected 
 by
 using Haskell as opposed to a different language?
   ● How did you convince management to go with a functional approach?
   ● Was the relative scarcity of Haskell programmers a problem?  If so, how 
 was
 it managed?
   ● Would you choose to use Haskell again for a similar project given what you
 know now?
 
  
 
 The best responses will not simply list answers, but also provide background
 and a bit of narrative on the project and insights gained.  Feel free to reply
 to the list, or just to me personally if you prefer.  My email is below.
 

I would also suggest you contact speakers from past CUFP meetings,
who've written all sorts of interesting summaries on the use of
Haskell (and other FP langs) in industry.

http://cufp.galois.com/

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Fastest regex package?

2009-02-06 Thread Don Stewart
allbery:
 On 2009 Feb 5, at 10:26, Eugene Kirpichov wrote:
 My benchmark (parsing a huge logfile with a regex like GET
 /foo.xml.*fooid=([0-9]++).*barid=([0-9]++)) shows that plain PCRE is
 the fastest one (I tried PCRE, PCRE-light and TDFA; DFA can't do
 capturing groups at all, TDFA was abysmally slow (about 20x slower
 than PCRE), and it doesn't support ++), but maybe have I missed any
 blazing-fast package?


 I think dons (copied) will want to hear about this; pcre-light is  
 supposed to be a fast lightweight wrapper for the PCRE library, and if  
 it's slower than PCRE then something is likely to be wrong somewhere.

Shouldn't be slower (assuming you're using bytestrings).

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Haskell tutorial for pseudo users?

2009-02-05 Thread Don Stewart
andrewcoppin:
 Deniz Dogan wrote:
 Learn You a Haskell for Great Good (http://learnyouahaskell.com/)

 Mmm, interesting.

 Does anybody else think it would be neat if GHCi really did colourise  
 your input like that? (Or at least display the prompt in a different  
 colour to user input and program output?)

I wrote about this a while ago,

http://haskell.org/haskellwiki/GHCi_in_colour

Needs integration with ghc-api, and we're done.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Happstack 0.1 Released!

2009-02-05 Thread Don Stewart
andrewcoppin:
 Jochem Berndsen wrote:
 The HAppS project has been abandoned, see
 http://groups.google.com/group/HAppS/msg/d128331e213c1031 .

 The Happstack project is intended to continue development. For more
 details, see http://happstack.com/faq.html .

   
 So we've got HAppS, Happstack, WASH, Turbinado, probably others... Does  
 anybody know how all these relate to each other? Where their strengths  
 and weaknesses lie?

 It's nice to have choice, but without knowing what you're choosing  
 between, it's hard to use it well.


A comparative analysis of the 10+ Haskell web frameworks would be
awesome.

happstack, wash, fastcgi.., turbinado, perpubplat, riviera, salvia,
kibro, ella, what was that one launched yesterday? *ah, yesod...
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: ANN: #haskell-in-depth IRC channel

2009-02-03 Thread Don Stewart
We explicitly want to avoid a newbie trap
See the summary of the discussion that lead to the channel creation

http://haskell.org/haskellwiki/IRC_channel/Phase_2

-- Don

DekuDekuplex:
 On Wed, 04 Feb 2009 00:15:48 +, Philippa Cowderoy
 fli...@flippac.org wrote:
 
 [...]
 
 If you need to know how to use monads so you can do IO,
 #haskell-in-depth isn't the place. On the other hand, if you want to
 discuss how Haskell's monads compare to the category theory or what the
 category theory can tell us about how individual monads relate to the
 language as a whole, -in-depth is a good place! In particular, we're
 hoping that the kind of category theory discussions that give the
 mistaken impression you actually need to know CT will increasingly live
 in #haskell-in-depth.
 
 We're not after a theory channel though - architectural discussion,
 compiler implementation, possible type system extensions, library
 design, all are good subjects.
 
 Great work!  I look forward to participating sometime in the near
 future.
 
 In that case, for people who need to know how to use monads so that
 they can do IO, why not create a #haskell-beginners channel?  I have
 occasionally read posts of some users who were hesitant to participate
 in #haskell until they learned enough to keep up with the discussions
 there.  If neither #haskell nor #haskell-in-depth is appropriate,
 perhaps they would feel more comfortable in a
 Haskell-beginners-specific channel?
 
 -- Benjamin L. Russell
 -- 
 Benjamin L. Russell  /   DekuDekuplex at Yahoo dot com
 http://dekudekuplex.wordpress.com/
 Translator/Interpreter / Mobile:  +011 81 80-3603-6725
 Furuike ya, kawazu tobikomu mizu no oto. 
 -- Matsuo Basho^ 
 
 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: 1,000 packages, so let's build a few!

2009-02-02 Thread Don Stewart
ndmitchell:
 Hi
 
  So actually just having more Windows users subscribed to cabal-devel and
  commenting on tickets would be very useful, even if you do not have much
  time for hacking.
 
 I believe that as soon as a Windows user starts doing that you'll
 start asking them for patches :-)
 
 There are a number of reasons that we have fewer Windows developers:
 
 * Some of it comes down to social reasons - for some reason it seems
 to be socially acceptable to belittle Windows (and Windows users) on
 the Haskell mailing lists and #haskell.
 
 * Some of it comes down to technical issues - for example not having
 cabal.exe bundled with GHC 6.10.1 on Windows was a massive mistake
 (although I've heard everyone argue against me, I've not yet heard a
 Windows person argue against me).
 
 * Part of it comes down to most developers not being Windows people.
 
 * A little is because Windows is a second class citizen even in the
 libraries, my OS is NOT mingw32 - mingw32 is not even an OS, its a
 badly typed expression! How would you like it if your OS was listed as
 Wine? Things like this tell me that Haskell isn't Windows friendly, at
 best its windows tolerant.
 
 * Things like Gtk2hs, which Windows users need building for them,
 don't release in sync with GHC, which makes it hard to use.
 
 * Windows machines don't usually have a C compiler, and have a very
 different environment - while the rest of the world is starting to
 standardise.
 
 I gave up on fighting the fight when people decided not to bundle
 cabal.exe with Windows - and now I'm too busy with my day job... Now
 I'd say Duncan is the most vocal and practical Windows developer, even
 overlooking the fact he doesn't run Windows.

GHC doesn't  bundle with cabal-install on any system.

What is needed is not for the GHC team to be doing Windows platform
packages, but for the Windows Haskell devs to build their own system, as
happens on all the Unices.

Take GHC's release, wrap it up with native installers, throw in useful
libraries and executables like cabal. Done.

It's not the GHC compiler team's job to build distro-specific bundles. 

So, wind...@haskell.org anyone? Get the wiki going, get the set of tasks
created.

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Verifying Haskell Programs

2009-02-02 Thread Don Stewart
pocmatos:
 Hi all,
 
 Much is talked that Haskell, since it is purely functional is easier 
to be verified.   However, most of the research I have seen in software
verification  (either through model checking or theorem proving)
targets C/C++ or  subsets of these. What's the state of the art of
automatically  verifying properties of programs written in Haskell?
 

State of the art is translating subsets of Haskell to Isabelle, and
verifying them. Using model checkers to verify subsets, or extracting
Haskell from Agda or Coq.

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: 1,000 packages, so let's build a few!

2009-02-02 Thread Don Stewart
jwlato:
 Duncan Coutts wrote:
 
  Some are trivial and should be done away with. For example the ones that
  just check if a C header / lib is present are unnecessary (and typically
  do not work correctly). The next point release of Cabal can do these
  checks automatically, eg:
 
 Configuring foo-1.0...
 cabal: Missing dependencies on foreign libraries:
 * Missing header file: foo.h
 * Missing C libraries: foo, bar, baz
 This problem can usually be solved by installing the system
 packages that provide these libraries (you may need the -dev
 versions). If the libraries are already installed but in a
 non-standard location then you can use the flags
 --extra-include-dirs= and --extra-lib-dirs= to specify where
 they are.
 
 Thank you!  Thank you!  Thank you!
 
 For those of us who want to write cross-platform (i.e. Windows)
 bindings to C libraries, this is great news.

It will be important now to report the lack of uses of these portability
tests back to the authors of packages.

A start would be to have hackage warn, I suppose.

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: 1,000 packages, so let's build a few!

2009-02-02 Thread Don Stewart
ganesh.sittampalam:
 Don Stewart wrote:
 
  GHC doesn't  bundle with cabal-install on any system.
  
  What is needed is not for the GHC team to be doing Windows platform
  packages, but for the Windows Haskell devs to build their own system,
  as happens on all the Unices.  
  
  Take GHC's release, wrap it up with native installers, throw in
  useful libraries and executables like cabal. Done. 
  
  It's not the GHC compiler team's job to build distro-specific bundles.
  
  So, wind...@haskell.org anyone? Get the wiki going, get the set of
  tasks created. 
 
 Isn't the Haskell Platform going to do all this? Shouldn't interested
 people just help out there?
 

The platform is a set of blessed libraries and tools. The distros will
still need to package that.

To do that for Windows, we're still going to need a windows packaging
team, along side Debian, Arch, Gentoo, Mac etc.

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Verifying Haskell Programs

2009-02-02 Thread Don Stewart
dbueno:
 On Mon, Feb 2, 2009 at 15:04, Don Stewart d...@galois.com wrote:
  pocmatos:
  Hi all,
 
  Much is talked that Haskell, since it is purely functional is easier 
  to be verified.   However, most of the research I have seen in software
  verification  (either through model checking or theorem proving)
  targets C/C++ or  subsets of these. What's the state of the art of
  automatically  verifying properties of programs written in Haskell?
 
 
  State of the art is translating subsets of Haskell to Isabelle, and
  verifying them. Using model checkers to verify subsets, or extracting
  Haskell from Agda or Coq.
 
 Don, can you give some pointers to literature on this, if any?  That
 is, any documentation of a verification effort of Haskell code with
 Isabelle, model checkers, or Coq?
 
 (It's not that I don't believe you -- I'd be really interested to read it!)


All on haskell.org,


http://haskell.org/haskellwiki/Research_papers/Testing_and_correctness#Verifying_Haskell_programs

And there's been work since I put that list together.

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Complex C99 type in Foreign

2009-02-01 Thread Don Stewart
briqueabraque:
 Hi,
 
 Are there plans to include C99 'complex' type
 in Foreign, maybe as CFloatComplex, CDoubleComplex
 and CLongDoubleComplex? This seems an easy addition
 to the standard and would allow binding of a few
 interesting libraries, like GSL.
 

A separate library for new types to add to Foreign would be the easiest
way forward. Just put the foreign-c99 package on Hackage?

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Takusen 0.8.3 install problems

2009-02-01 Thread Don Stewart
alistair:
   You can probably just remove the Setup.lhs and build with defaults
   (we're doing that at galois, we use Takusen).
  
   -- Don
 
 I'm surprised this works, unless you also change the imports of
 Control.Exception to Control.OldException. The new exception module is
 part of the reason it's taking me a while to port to 6.10.1. Nearly
 there though; only the haddock failures to fix and then we can
 release.

build-depends: base  4
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: Complex C99 type in Foreign

2009-02-01 Thread Don Stewart
briqueabraque:
 Are there plans to include C99 'complex' type
 in Foreign, maybe as CFloatComplex, CDoubleComplex
 and CLongDoubleComplex? This seems an easy addition
 to the standard and would allow binding of a few
 interesting libraries, like GSL.
 
 A separate library for new types to add to Foreign would be the easiest
 way forward. Just put the foreign-c99 package on Hackage?
 
 As far as I know, this is not possible. (I tried for
 a long time to do that, actually, until I reallized
 it could not be done.)
 
 If it's not true, i.e., I could actually have some
 arbitrary sized parameter as argument to a function
 or as a return value (and not its pointer), what
 did I saw wrong? I understand only Foreign.C.C*
 types or forall a. = Foreign.Ptr.Ptr a can be used
 like that.

Oh, you mean you need to teach the compiler about unboxed complex types?

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Takusen 0.8.3 install problems

2009-01-31 Thread Don Stewart
praki.prakash:
 I am trying to install Takusen 0.8.3 with ghc 6.10.1 on Ubuntu 8.04
 (same issue on Win XP as well). I get the following complaint from
 cabal.
 
Module
`Distribution.PackageDescription'
does not export
`writeHookedBuildInfo'
 cabal: Error: some packages failed to install:
 Takusen-0.8.3 failed during the configure step. The exception was:
 exit: ExitFailure 1

You can probably just remove the Setup.lhs and build with defaults
(we're doing that at galois, we use Takusen).

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] 1,000 packages, so let's build a few!

2009-01-31 Thread Don Stewart
andrewcoppin:
 In celebration of Hackage reachin over 1,000 unique packages, I decided 
 that I would re-visit the problem of attempting to build them on Windows.
 
 Ah yes, I already have the tarball for stream-fusion-0.1.1, but I see 
 that the latest release is 0.1.2.1. (Unfortunately, there doesn't appear 
 to be any way to determine what the difference is between the two 
 versions...)

the true way to install all of hackage is:

cabal install $(all my packages)

where cabal install solves it all.

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] 1,000 packages, so let's build a few!

2009-01-31 Thread Don Stewart
bugfact:
  the true way to install all of hackage is:
 
 cabal install $(all my packages)
 
  where cabal install solves it all.
 
not really :) e.g. my output on a Windows Vista system with GHC 6.10.1
cabal install sdl
Resolving dependencies...
Downloading SDL-0.5.4...
[1 of 1] Compiling Main (
C:\Users\Peter\AppData\Local\Temp\TMPSDL-0.5.4\SDL-0.5.4\Setup.lhs,
C:\Users\Peter
\AppData\Local\Temp\TMPSDL-0.5.4\SDL-0.5.4\dist\setup\Main.o )
C:\Users\Peter\AppData\Local\Temp\TMPSDL-0.5.4\SDL-0.5.4\Setup.lhs:2:2:
Warning: In the use of `defaultUserHooks'
 (imported from Distribution.Simple):
 Deprecated: Use simpleUserHooks or autoconfUserHooks, unless
you need Cabal-1.2
 compatibility in which case you must stick with
defaultUserHooks
Linking

 C:\Users\Peter\AppData\Local\Temp\TMPSDL-0.5.4\SDL-0.5.4\dist\setup\setup.exe
...
Warning: defaultUserHooks in Setup script is deprecated.
Configuring SDL-0.5.4...
setup.exe: sh: runGenProcess: does not exist (No such file or directory)
cabal: Error: some packages failed to install:
SDL-0.5.4 failed during the configure step. The exception was:
exit: ExitFailure 1

Isn't this missing C library dependencies, which cabal head now warns
about?

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Takusen 0.8.3 install problems

2009-01-31 Thread Don Stewart
build-type: Simple

praki.prakash:
 Don,
 
 Thanks for the hint. I removed Setup.hs and tried cabal build.  I
 get an error that build type is custom and Setup.lhs is missing. What
 is the magical incantation needed to do the default build?
 
 Thanks
 Praki
 
 On Sat, Jan 31, 2009 at 12:30 PM, Don Stewart d...@galois.com wrote:
  praki.prakash:
  I am trying to install Takusen 0.8.3 with ghc 6.10.1 on Ubuntu 8.04
  (same issue on Win XP as well). I get the following complaint from
  cabal.
 
 Module
 `Distribution.PackageDescription'
 does not export
 `writeHookedBuildInfo'
  cabal: Error: some packages failed to install:
  Takusen-0.8.3 failed during the configure step. The exception was:
  exit: ExitFailure 1
 
  You can probably just remove the Setup.lhs and build with defaults
  (we're doing that at galois, we use Takusen).
 
  -- Don
 
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] 1,000 packages, so let's build a few!

2009-01-31 Thread Don Stewart
sebastian.sylvan:
 
 
 --
 From: Don Stewart d...@galois.com
 Sent: Saturday, January 31, 2009 8:35 PM
 To: Andrew Coppin andrewcop...@btinternet.com
 Cc: haskell-cafe@haskell.org
 Subject: Re: [Haskell-cafe] 1,000 packages, so let's build a few!
 
 andrewcoppin:
 In celebration of Hackage reachin over 1,000 unique packages, I decided
 that I would re-visit the problem of attempting to build them on Windows.
 
 Ah yes, I already have the tarball for stream-fusion-0.1.1, but I see
 that the latest release is 0.1.2.1. (Unfortunately, there doesn't appear
 to be any way to determine what the difference is between the two
 versions...)
 
 the true way to install all of hackage is:
 
cabal install $(all my packages)
 
 where cabal install solves it all.
 
 If that had actually worked it would be great I must say that my own 
 not-so-random sampling (basically ooh that looks cool, let's try it) is 
 probably at a 20% success rate or so... It's great when it does work, but 
 it usually doesn't.
 
 Usually it fails because some part of it tries to run unix shell scripts 
 (and I try to avoid things which seem like they're unix only, even though 
 they're no easy way of determining this, so these are packages that at 
 least to me seemed like they could be perfectly portable if not for 
 unix-specific installation procedures). 
 

Windows people need to set up a wind...@haskell.org to sort out their
packaging issues, like we have for debian, arch, gentoo, freebsd and
other distros.

Unless people take action to get things working well on their platform,
it will be slow going.

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] unboxed, functional ATS language beats C++

2009-01-24 Thread Don Stewart
Note the inline C as well.

agocorona:
[1]Language Shootout: ATS is the new top gunslinger. Beats C++

 [2]http://www.reddit.com/r/programming/comments/72hmw/language_shootout_ats_is_the_new_top_gunslinger/
 
...Many people somehow think that ATS is fast because of its support for
advanced types such as dependent types and linear types. Actually, types
are primarily for enhancing safety rather than speed. The efficiency of
ATS is largely rooted in its data representation (flat instead of boxed)
and its support for tail-call optimization, which is vital for a
functional language.
 
What is interesting abut this ML derived language is the speed. The
theoriem proving facilities seems like a language extensions for
 property checkings mainly for his non pure features. The type system
seems to aid on the safety of pointer arithmetics and other dangerous
operations.
 
 References
 
Visible links
1. http://shootout.alioth.debian.org/u64q/benchmark.php?test=alllang=all
2. 
 http://www.reddit.com/r/programming/comments/72hmw/language_shootout_ats_is_the_new_top_gunslinger/

 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Arch Haskell News: Jan 24 2009

2009-01-24 Thread Don Stewart
A regular update of Haskell in Arch Linux
http://archhaskell.wordpress.com/2009/01/24/arch-haskell-news-jan-24-2009/

* Arch now has 864 Haskell packages in AUR.

That’s an increase of 37 new Haskell packages in the last 13 days, or
2.8 new Haskell apps and libraries a day packaged so far in January.

Cheers,
  Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] ANN: gitit 0.5

2009-01-24 Thread Don Stewart
Thanks for this! I'm a daily, heavy gitit user, and am happy to see
continued improvements to this excellent app.

-- Don

jgm:
 We are pleased to announce the latest release of Gitit, the
 multitalented distributed wiki written in Haskell.
 
 What's new in this release?
 
 * 'Gitit' is now something of a misnomer, as Gitit now makes use of
   the filestore library. The upshot is that Gitit can now work in Darcs
   repositories; if before you thought Gitit was cool but didn't like
   git, you now have no excuse!
 
 * Gitit has been optimized (thanks to the efforts of Gwern Branwen):
   - Pages are now gzipped whenever possible.
   - Expire headers are set so that CSS, images, and javascripts
 will be cached by the browser.
   - Those previously mentioned elements have been optimized for space,
 and rearranged in the generated pages for faster rendering.
 
 * A new configuration option allows reStructuredText to be used instead
   of markdown (thanks to a patch from Simon Michael).
 
 * Gitit now sports a 'Go' box. You can now either search through
   Search, or go to a specific page title via Go.
 
 * Search is smarter, and can also return page titles.
 
 * Revisions are better formatted: the author field now include the
   user's email as well.
 
 * Diffs are of much higher quality, thanks to filestore.
 
 * UTF8-related fixes.
 
 You can check out a running example at http://gitit.johnmacfarlane.net/.
 
 Or try it locally:
 
   cabal update
   cabal install -fhighlighting pandoc gitit
   gitit  # note: this will create two subdirectories in the working directory
  # then browse to http://localhost:5001.
 
 The git repository for Gitit is at http://github.com/jgm/gitit/tree/master
 
 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Processor availability

2009-01-22 Thread Don Stewart
wasserman.louis:
How might I go about finding out how many processors are available in a
concurrent GHC program?  I have some code I'd like to parallelize, but I
don't want to spawn a separate (even lightweight) thread for each of
thousands of minor tasks.
 
Louis Wasserman
[1]wasserman.lo...@gmail.com

You set the number of OS threads with +RTS -N at runtime. This value
is accessible from Haskell via:

GHC.Conc:

-- | the value passed to the @+RTS -N@ flag.  This is the number of
-- Haskell threads that can run truly simultaneously at any given
-- time, and is typically set to the number of physical CPU cores on
-- the machine.
numCapabilities :: Int

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] 1000 libraries

2009-01-21 Thread Don Stewart
We've done it!

http://hackage.haskell.org/cgi-bin/hackage-scripts/stats
274 users have uploaded 3161 versions of 1000 packages. 

Thanks everyone who has written a library or tool or app and released
it, for making hackage and cabal a success!

This has gone further, perhaps more than anything else, towards making
it possible to use Haskell in industry.

The lucky 1000th package is:

http://hackage.haskell.org/cgi-bin/hackage-scripts/package/threadPool-0.1
threadPool: Runs other programs in the manner of a thread pool

Takes a single, optional argument which is the number of threads
(the default is three). Give it the commands to run, one per line,
through standard input. 

Author  Brian Jaress

Now, onto 10k libraries!

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Pure Haskell implementation of Float type?

2009-01-20 Thread Don Stewart
catamorphism:
 Hello,
 Is there a pure Haskell implementation of Floats, i.e., one that
 (unlike GHC.Float) doesn't use foreign calls for things like
 isFloatNegativeZero? I don't care about performance; I'm just looking
 for something that doesn't use foreign calls.
 

Huh, what's the use case?

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Why monoids will abide...

2009-01-20 Thread Don Stewart
http://apfelmus.nfshost.com/monoid-fingertree.html

Thanks Apfelmus for this inspiring contribution!
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] plugins can not be installed in ghc 6.10.1

2009-01-19 Thread Don Stewart
agocorona:
Do really pluigins needs Cabal (=1.4  1.5) ???
C:\Documents and Settings\Administratorcabal install plugins
Resolving dependencies...
cabal: dependencies conflict: ghc-6.10.1 requires Cabal ==1.6.0.1 however
Cabal-1.6.0.1 was excluded because plugins-1.3.1 requires Cabal ==1.4.*


Patches welcome. Probably switching to the 1.6 API won't be too hard.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Haskell WikiProject

2009-01-19 Thread Don Stewart
greenrd:
 Is anyone else interested in forming a Haskell WikiProject on Wikipedia,
 to collaborate on improving and maintaining the coverage and quality of
 articles on Haskell-related software and topics (broadly defined)? Not
 just programming topics specific to Haskell, but also ones of interest
 to the Haskell community.
 
 Some of you might already be doing this from time to time, but forming
 an explicit WikiProject might help to:
 
 * Highlight things that could use some attention
 * Divide up tasks (based on expertise or interest)
 * Recruit more editors (sticking a banner on article Talk pages can let
   editors know the WikiProject exists)
 * Eventually (something for the future, maybe!) work together on a
   Wikipedia Haskell Portal
 * And of course, improve the visibility of Haskell on Wikipedia, which
   should help our community
 
 Here's a good example to start with. The article on Eager evaluation
 could do with some improvement - and possibly should be merged into the
 Lazy evaluation article, I'm not sure:
 
 http://en.wikipedia.org/wiki/Eager_evaluation
 
 We could also probably create some more articles on projects written
 in Haskell, and add more references to Haskell research papers.
 Software projects don't have to be polished to be covered in Wikipedia -
 or even working! - they essentially just have to be notable, as the
 Wikipedia guidelines define it.
 
 By the way (getting a bit offtopic here) an annoying limitation of the
 Wikipedia category system, that you couldn't run queries like Give me
 all the articles in the Haskell category that are also in the
 Unreferenced category has now been partially addressed by the
 experimental prototype of Category Intersection:
 
 http://toolserver.org/~dschwen/intersection/
 
 This is slightly better than Googling, because crucially, it searches
 *recursively* through categories. That means it will turn up articles
 that are in a subcategory of Category:Haskell programming language but
 don't explicitly mention Haskell. Don't know if there any such articles
 yet, but it's worth bearing in mind that you can do this. I think it
 will, in principle, make topic-specific maintenance a bit more
 convenient - and it's what I've been waiting for before getting
 involved in topic-specific maintenance.
 
 If you want to just express interest in signing up for such a
 WikiProject (no commitment required whatsoever!), please reply
 privately via email or publicly on my User Talk page (User talk:Greenrd)
 - to avoid clogging up this mailing list.

Yes!

Also, we have many good writers who've written extensively on topics on
blogs who I'm sure would be happy to donate content.

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Employment

2009-01-19 Thread Don Stewart
And of course, there's at least half a dozen people on this list at
working at Galois.

And all documented on the wiki,

http://haskell.org/haskellwiki/Haskell_in_industry

See you guys at CUFP 09!

http://cufp.galois.com/

-- Don

pbeadling:
 Barclays Capital use it for Equity Derivative modeling and pricing - it's a
 small team at the moment, but the whole project is in Haskell.
 
 I don't work on it myself so I couldn't give you any details (plus I would
 get fired for blabbing!), I work in an adjacent group.  Haskell certainly
 lends itself to complex financial maths simulation tho, so I think they've
 made a good choice.
 
 
 On 19/01/2009 19:34, Andrew Coppin andrewcop...@btinternet.com wrote:
 
  Is it possible to earn money using Haskell? Does anybody here actually
  do this?
  
  Inquiring minds want to know... ;-)
  
  ___
  Haskell-Cafe mailing list
  Haskell-Cafe@haskell.org
  http://www.haskell.org/mailman/listinfo/haskell-cafe
 
 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Optimistic evaluation

2009-01-18 Thread Don Stewart
andrewcoppin:
 Hi folks.
 
 I just read a rather interesting paper about a fork of GHC that performs 
 optimistic evaluation. This shows big wins in some cases.
 
 The authors claim to have implemented this in a fork of GHC and promised 
 that it would be integrated into the production compiler in the near 
 future. Curios, I investigated the GHC wiki...
 
 Well, let's see now. The front page has links to out release plans for 
 6.8.3 and what will be in 6.10. The latter page,
 
 http://hackage.haskell.org/trac/ghc/wiki/Status/Releases
 
 mentions that a beta has just been released... and seems oblivious to 
 the fact that 6.10.1 is production now. Clearly, any hopes I might have 
 had of getting a handle on the current status of GHC from this wiki were 
 dashed somewhat. ;-)
 
 Does anybody have any suggestions for a more reliable way of figuring 
 out what the current activities and plans for GHC are?

I'm assuming you're talking about the 'eager evaluation' papers? (There
were a few). I think the verdict was that the runtime machinery was
too complex for the performance gain.

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] runghc Setup.hs doitall

2009-01-18 Thread Don Stewart
duncan.coutts:
 On Sun, 2009-01-18 at 17:58 +0100, Daniel Fischer wrote:
  Am Sonntag, 18. Januar 2009 17:22 schrieb Sebastian Sylvan:
   Is there some sort of bundle that you can use to install cabal-install
   easily? Because it looks to me like I'd have to spend the better part of 
   an
   evening manually downloading and installing the gazillion of dependencies
   it has, which is far too much work when I just wanted to spend ten minutes
   playing with some package...
  
  
  Wait, 'gazillion of dependencies'? If you have the extralibs bundle built, 
  there are only three dependencies to take care of
  - a recent Cabal library
  - HTTP
  - zlib
 
 I think the problem is that hackage is misleading. It looks from the
 hackage page like there are a gazillion dependencies when in fact as you
 say there are only 2 that are not included with the latest ghc.
 
 The solution some have suggested would be for hackage to only list
 dependencies that are not in some core set.

Hmm. That's interesting. As we do in the distro tools, for example, 

makedepends=('ghc=6.10.1' 'haskell-http4000' 'haskell-zlib')


http://repos.archlinux.org/viewvc.cgi/community/devel/cabal-install/PKGBUILD?revision=1.1root=communitypathrev=CURRENT

So the distro packaging tools already have the 'implicit set' of things
we know are on the system if ghc is on it too.

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Comments from OCaml Hacker Brian Hurt

2009-01-18 Thread Don Stewart
ross:
 On Sat, Jan 17, 2009 at 09:12:32PM -0500, a...@spamcop.net wrote:
  And FWIW, I agree with everyone who has commented that the documentation
  is inadequate.  It'd be nice if there was some way to contribute better
  documentation without needing checkin access to the libraries.
 
 There is.  The current state of the docs may be viewed at
 
   http://www.haskell.org/ghc/dist/current/docs/libraries/
 
 Anyone can check out the darcs repos for the libraries, and post
 suggested improvements to the documentation to librar...@haskell.org
 (though you have to subscribe).  It doesn't even have to be a patch.
 
 Sure, it could be smoother, but there's hardly a flood of contributions.

I imagine if we set up a wiki-like system where the entire hackage docs
could be edited, as well as viewed, we would end up with a flood.

A modification to haddock perhaps, that sends edits to generated docs to 
libraries@ ?

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Anybody in Savannah?

2009-01-18 Thread Don Stewart
ketil:
 
 Hi,
 
 I arrived in Savannah yesterday (to attend PADL), and have spent the
 most part of the day drifting aimlessly around.  Thrilling as that may
 be, I thought perhaps there might be other members of the Haskell
 community around, and that perhaps we could arrange to meet informally
 for coffee, beer, dinner?

Some Galwegians will be at POPL and related events.

http://www.galois.com/blog/2009/01/18/galois-at-popl/

Say hi to them :)

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Comments from OCaml Hacker Brian Hurt

2009-01-18 Thread Don Stewart
david.waern:
 2009/1/18 Don Stewart d...@galois.com:
  ross:
  On Sat, Jan 17, 2009 at 09:12:32PM -0500, a...@spamcop.net wrote:
   And FWIW, I agree with everyone who has commented that the documentation
   is inadequate.  It'd be nice if there was some way to contribute better
   documentation without needing checkin access to the libraries.
 
  There is.  The current state of the docs may be viewed at
 
http://www.haskell.org/ghc/dist/current/docs/libraries/
 
  Anyone can check out the darcs repos for the libraries, and post
  suggested improvements to the documentation to librar...@haskell.org
  (though you have to subscribe).  It doesn't even have to be a patch.
 
  Sure, it could be smoother, but there's hardly a flood of contributions.
 
  I imagine if we set up a wiki-like system where the entire hackage docs
  could be edited, as well as viewed, we would end up with a flood.
 
  A modification to haddock perhaps, that sends edits to generated docs to 
  libraries@ ?
 
 This has come up many times lately. I've created a ticket for it:
 
   http://trac.haskell.org/haddock/ticket/72
 
 If anyone has suggestions for design or implementation of a system
 like this, don't hesitate to post to this ticket!
 

Added to the entry on the proposals tracker,

http://www.reddit.com/r/haskell_proposals/

If nothing else, this would make a good SoC project.

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Slow Text.JSON parser

2009-01-17 Thread Don Stewart
It occurs to me you could also use attoparsec, which is specifically
optimised for bytestring processing.

sjoerd:
 Hi,
 
 Somebody told me about Parsec 3, which uses a Stream type class so it  
 can parse any data type. This sounded like the right way to do  
 encoding independent parsing, so I decided to see how it would work to  
 parse UTF8 JSON.
 
 Sadly I could not use Text.JSON.Parsec directly, because it uses the  
 old Parsec CharParser type. So I copied to code, and also replaced  
 p_number with the floating parser from Text.Parsec.Token, because  
 Text.JSON.Parsec uses readFloat (a dirty hack imho) which works only  
 on String.
 
 If Text.JSON.Parsec was written for Parsec 3, the only thing to write  
 to get UTF8 JSON parsing would be:
 
 instance (Monad m, U.UTF8Bytes string index) = Stream (U.UTF8 string)  
 m Char where
 uncons = return . U.uncons
 
 I did not do any performance measuring yet, I was glad I got it  
 working. Any comments on the code is appreciated!
 
 greetings,
 Sjoerd Visscher
 
 {-# LANGUAGE FlexibleInstances, MultiParamTypeClasses,  
 UndecidableInstances #-}
 import qualified Data.String.UTF8 as U
 import qualified Data.ByteString as B
 
 import Text.Parsec hiding (many, optional, (|))
 import Control.Applicative
 
 import Text.JSON.Types
 import Control.Monad
 import Data.Char
 import Numeric
 
 instance (Monad m, U.UTF8Bytes string index) = Stream (U.UTF8 string)  
 m Char where
 uncons = return . U.uncons
 
 type CharParser st = Parsec (U.UTF8 B.ByteString) st
 
 parseFile :: FilePath - IO (Either ParseError JSValue)
 parseFile fileName = do
   bs - B.readFile fileName
   return $ runParser json () fileName (U.fromRep bs)
 
 parseString  :: String - Either ParseError JSValue
 parseString s = runParser json () (unknown) (U.fromString s)
 
 json :: CharParser () JSValue
 json  = spaces * p_value
 
 tok  :: CharParser () a - CharParser () a
 tok p = p * spaces
 
 p_value  :: CharParser () JSValue
 p_value   =  (JSNull  $  p_null)
  | (JSBool  $ p_boolean)
  | (JSArray $ p_array)
  | (JSString$ p_js_string)
  | (JSObject$ p_js_object)
  | (JSRational False $ p_number)
  ? JSON value
 
 p_null   :: CharParser () ()
 p_null= tok (string null)  return ()
 
 p_boolean:: CharParser () Bool
 p_boolean = tok
   (  (True  $ string true)
  | (False $ string false)
   )
 
 p_array  :: CharParser () [JSValue]
 p_array   = between (tok (char '[')) (tok (char ']'))
   $ p_value `sepBy` tok (char ',')
 
 p_string :: CharParser () String
 p_string  = between (tok (char '')) (char '') (many p_char)
   where p_char=  (char '\\'  p_esc)
  | (satisfy (\x - x /= ''  x /= '\\'))
 
 p_esc =  (''   $ char '')
  | ('\\'  $ char '\\')
  | ('/'   $ char '/')
  | ('\b'  $ char 'b')
  | ('\f'  $ char 'f')
  | ('\n'  $ char 'n')
  | ('\r'  $ char 'r')
  | ('\t'  $ char 't')
  | (char 'u' * p_uni)
  ? escape character
 
 p_uni = check = count 4 (satisfy isHexDigit)
   where check x | code = max_char  = pure (toEnum code)
 | otherwise = empty
   where code  = fst $ head $ readHex x
 max_char  = fromEnum (maxBound :: Char)
 
 p_object :: CharParser () [(String,JSValue)]
 p_object  = between (tok (char '{')) (tok (char '}'))
   $ p_field `sepBy` tok (char ',')
   where p_field   = (,) $ (p_string * tok (char ':')) * p_value
 
 p_number :: CharParser () Rational
 p_number  = tok floating where
 
 floating   :: CharParser () Rational
 floating= do{ n - decimal
 ; fract - option 0 fraction
 ; expo  - option 1 exponent'
 ; return ((fromInteger n + fract)*expo)
 }
 
 fraction= do{ char '.'
 ; digits - many1 digit ? fraction
 ; return (foldr op 0 digits)
 }
   ? fraction
 where
   op d f= (f + fromIntegral (digitToInt d))/10
 
 exponent'   = do{ oneOf eE
 ; f - sign
 ; e - decimal ? exponent
 ; return (power (f e))
 }
   ? exponent
 where
power e  | e  0  = 1/power(-e)
 | otherwise  = fromInteger 

Re: [Haskell-cafe] ANNOUNCE: Coadjute 0.0.1, generic build tool

2009-01-17 Thread Don Stewart
matti.niemenmaa+news:
 Announcing the release of Coadjute, version 0.0.1!
 
 Web site: http://iki.fi/matti.niemenmaa/coadjute/
 Hackage: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/Coadjute
 

Here's an Arch Linux package for it,

http://aur.archlinux.org/packages.php?ID=23237
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] ANNOUNCE: Coadjute 0.0.1, generic build tool

2009-01-17 Thread Don Stewart
ilmari.vacklin:
 2009/1/18 Matti Niemenmaa matti.niemenmaa+n...@iki.fi:
  Announcing the release of Coadjute, version 0.0.1!
 
 Hi,
 
 trying to build on GHC 6.10.1 I get:
 
 Building regex-dfa-0.91...
 
 Text/Regex/DFA/Common.hs:6:7:
 Could not find module `Data.IntMap':
   it is a member of package containers-0.2.0.0, which is hidden
 cabal: Error: some packages failed to install:
 Coadjute-0.0.1 depends on regex-dfa-0.91 which failed to install.
 regex-dfa-0.91 failed during the building phase. The exception was:
 exit: ExitFailure 1

regex-dfa needs this patch, attached. Or use the native package for it
on your distro ... :)

-- Don

--- regex-dfa.cabal.old 2009-01-17 16:10:53.0 -0800
+++ regex-dfa.cabal 2009-01-17 16:12:26.0 -0800
@@ -13,7 +13,7 @@
 Description:The lazy DFA engine, based on CTKLight, for regex-base
 Category:   Text
 Tested-With:GHC
-Build-Depends:  regex-base = 0.80, base = 2.0, parsec, mtl
+Build-Depends:  regex-base = 0.80, containers, base = 2.0, 
bytestring, parsec, mtl, array
 -- Data-Files:
 -- Extra-Source-Files:
 -- Extra-Tmp-Files:
@@ -37,7 +37,7 @@
 -- HS-Source-Dirs: .
 Extensions: MultiParamTypeClasses, FunctionalDependencies
 -- GHC-Options:-Wall
-GHC-Options:-Wall -Werror -O2
+GHC-Options:-Wall -O2
 -- GHC-Options:-Wall -ddump-minimal-imports
 -- GHC-Prof-Options: 
 -- Hugs-Options:
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Hackage about to reach 1000 releases

2009-01-17 Thread Don Stewart
Hackage is about to reach the 1000 release mark, 2 years after it went
live. 

That's right: in 2 years we've gone from having only a handful of
released projects, to one thousand! Well done everyone!

I did some quick visualisation of the rate of new releses, diversity of
packages, and community growth over the period:


http://archhaskell.wordpress.com/2009/01/18/open-source-haskell-releases-and-growth/

I'm very happy about the diversity of hackage apps, and the pleasing
rate of growth of new releases.

None of this would have been possible with out thousands of hours of
work from the Cabal and Hackage hackers, the compiler teams, and the
developers themselves.

Keep churning out new and intresting code everyone!

-- Don

P.S. cabal install
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] What could be considered standard Haskell these days?

2009-01-16 Thread Don Stewart
briqueabraque:
 Hi,
 
 I would like to take some time to study Haskell properly, so
 that I could help others and pay my debt for the many times
 I had to bother with my syntax questions. And, of course,
 make better use of the language.
 
 My first attempt was to read the syntax description in
 Haskell 98 report, and that helped a lot. But I've realized
 that it's far from the language as used today. But just
 adding all available extensions would not be good, as some
 are very experimental e others are obsolete.
 
 I saw Haskell-prime page and a few features are marked
 as accepted. That mean I can trust them to be part of the
 next Haskell standard?
 
 So: if someone wants to learn the details of the language,
 what could be the subset of extensions one should learn
 and make regular use, and also include in code supposed
 to be used by others in the long term?

Have a look at the accepted extensions for Haskell Prime.

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] ANN: HTTPbis / HTTP-4000.x package available

2009-01-16 Thread Don Stewart
lemming:
 
 On Thu, 15 Jan 2009, Sigbjorn Finne wrote:
 
 I guess it's time to publish more widely the availability of a 
 modernization of the venerable and trusted HTTP package, which I've been 
 working on offon for a while.
 
  I was always afraid that a fork may happen during I work on HTTP in order 
 to get it more lazy. That's why I started discussion on web-devel mailing 
 list, but got only limited response. I also notified Bjorn, that my 
 changes need still a little time and that I'm worried about darcs 
 conflicts. Seems that we now run into a perfect conflict. I don't like to 
 throw away the work that I have done the last weeks.
 
 My version is at
   http://code.haskell.org/~thielema/http/

There's absolutely no need to throw away work. Hackage is a broad
church, release it as http-lazy, at the very least.

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Haskell not ready for Foo [was: Re: Hypothetical Haskell job in New York]

2009-01-16 Thread Don Stewart
john:
 
 On Jan 15, 2009, at 9:31 AM, John Goerzen wrote:
 By pure do you mean containing python code only?  I'm looking
 through a few, and:
 
 Search for pure python mysql or pure python postgresql and you'll  
 see at least two implementations. In addition, there are plenty of  
 pure Python databases for those who want and are able to stay strictly  
 within Python.
 

FWIW, there are pure Haskell storage APIs. See e.g. HAppS-State and TCache.

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


<    3   4   5   6   7   8   9   10   11   12   >