[Haskell-cafe] Re: Go Haskell!
marlowsd at gmail.com
Thu Nov 27 09:19:04 EST 2008
Claus Reinke wrote:
>> Do you have an example of a mutable state/ IO bound application, like,
>> hmm, a window manager or a revision control system or a file system...?
> If you're looking for a challenge, how about this one (there used to
> be lots of Haskellers into this game, any of you still around?-):
[ catching up with old haskell-cafe email ]
Interestingly, I did this a while ago. Here's my results:
$ ./Bench 1 100000
b: 14840, w: 17143 mercy: 67982
elapsed time: 3.42s
so, nearly 30k/sec random playouts on 9x9. That's using a hack that stops
the game when the score is heavily in favour of one player, it drops to
around 20k/sec with that turned off.
Not bad, but probably I'd guess an order of magnitude worse than you can do
in tightly-coded C. The Haskell implementation isn't nice, as you
predicted. Also the code is derived from some non-free internal MS code,
so unfortunately I can't share it (but I could perhaps extract the free
bits if anyone is really interested).
W wins slightly more often I think because komi 5.5 on a 9x9 board is a tad
It does parallelise too, of course:
$ ./Bench 8 100000 +RTS -N8
b: 14872, w: 17488 mercy: 67584
elapsed time: 1.00s
though still room for improvement there.
More information about the Haskell-Cafe