[Haskell-cafe] Array Binary IO & molecular simulation

Claus Reinke claus.reinke at talk21.com
Fri May 1 07:10:38 EDT 2009

> So I wonder of existing projects of such type, both Molecular dynamics and Monte Carlo methods. 

The fastest Haskell Monte Carlo code I've seen in action is 
Simon's port of a Monte Carlo Go engine:


That is competitive to lightly optimised non-Haskell versions, though
not competitive with highly optimised versions (the kind that slows
down when you update your compiler, but gives you dramatic boosts
due to detailed attention both to generated assembly code and to 
high-level algorithm shortcuts).

Though there's also specialization as an option


and googling for "haskell monte carlo" give a few more hits, such as


and even some hackage package, though I don't know whether
efficiency was a concern there?

>I've got also some technical questions. Now I'm using 2D DiffUArray 
>to represent particle positions during the simulation (when there are lots 
>of array updates). Is this reasonably fast (I want to use pure external 
>interface of DiffArray)?

DiffArray is slow (don't know about DiffUArray):

The default Random is also slow (see the mersenne alternatives on
hackage instead, and be careful if you use them through the standard
class interface):



More information about the Haskell-Cafe mailing list