[Haskell-cafe] Game of life in haskell.

Tony Finch dot at dotat.at
Tue Feb 2 16:07:59 EST 2010


On Tue, 2 Feb 2010, Arne D Halvorsen wrote:
>
> If I may butt in here: to get a scalable, fast Game of Life, you should look
> into Hashlife (by Gosper?) as exemplified in the open source application
> Golly. It gives an astonishing speedup, and it would be interesting to see it
> expressed in Haskell.

I played around with implementing hashlife a few years ago. It is a truly
beautiful algorithm, and mind-expanding if all you know is representing
Life as an array of booleans.

The problem with implementing it in Haskell is it relies on persistent
object identities (of the branches of a quadtree) that it hashes in order
to memoize quadtree creation. This makes what ought to be a beautifully
quasi-functional algorithm look ugly and imperative.

Tony.
-- 
f.anthony.n.finch  <dot at dotat.at>  http://dotat.at/
GERMAN BIGHT HUMBER: SOUTHWEST 5 TO 7. MODERATE OR ROUGH. SQUALLY SHOWERS.
MODERATE OR GOOD.


More information about the Haskell-Cafe mailing list