with Julian Sutherland
Cellular automata (CA) is one of the prime examples of artificial life, as well as the emergence of complex structures at the systemic level from simple interactions between the individual parts of the system. Moreover, CA are defined iteratively over time, and manifest such complex properties even when their definition is fully deterministic.
Oftentimes CA are implemented using procedural or object-oriented programming. In this project, we explore functional implementations with the use of comonadic computations.
I wrote a beautiful but naive Haskell implementation of Wolfram's elementary cellular automata (ECA) in 30 lines. It can generate the evolution of all 256 rules from a default starting configuration and (slowly) save them to PNG images.
I wrote a more efficient Haskell implementation of Wolfram's elementary cellular automata using Comonadic Arrays. I also extended it to 2D worlds and played with Conway's game of life.