Conways Game of Life in Erlang with Wx GUI
Posted4 months agoActive4 months ago
github.comTechstory
supportivepositive
Debate
10/100
ErlangGame of LifeConcurrency
Key topics
Erlang
Game of Life
Concurrency
A developer shares their implementation of Conway's Game of Life in Erlang with a GUI, highlighting its concurrent processing features.
Snapshot generated from the HN discussion
Discussion Activity
Light discussionFirst comment
7m
Peak period
1
0-1h
Avg / period
1
Key moments
- 01Story posted
Aug 22, 2025 at 11:14 PM EDT
4 months ago
Step 01 - 02First comment
Aug 22, 2025 at 11:22 PM EDT
7m after posting
Step 02 - 03Peak activity
1 comments in 0-1h
Hottest window of the conversation
Step 03 - 04Latest activity
Aug 22, 2025 at 11:22 PM EDT
4 months ago
Step 04
Generating AI Summary...
Analyzing up to 500 comments to identify key contributors and discussion patterns
ID: 44992789Type: storyLast synced: 11/18/2025, 12:02:30 AM
Want the full context?
Jump to the original sources
Read the primary article or dive into the live Hacker News thread when you're ready.
I built Conway's Game of Life in Erlang where each cell is an independent actor process. This means a 70x45 grid runs 3,150 concurrent processes, all communicating via message passing to determine their fate each generation.
## Why this is interesting
Most Game of Life implementations use a 2D array with a loop. This one uses the actor model - each cell is literally an independent process that: - Maintains its own alive/dead state - Sends its state to its 8 neighbors each tick - Receives states from neighbors via message passing - Calculates its next state based on Conway's rules - No shared memory, no locks, pure message passing
## The implementation
Each cell is a gen_server that knows its neighbors' PIDs. Every generation: 1. All cells broadcast their state to neighbors 2. Each cell waits to receive all 8 neighbor states 3. Cells calculate their next state (birth/survival/death) 4. Grid coordinator signals all cells to evolve simultaneously
The visualization uses wxWidgets (built into Erlang/OTP) to show cells as cyan squares on a dark grid. Includes classic patterns like glider guns that continuously spawn new gliders.
## Cool observations
- The glider gun creates new "actors" (gliders) that then live independently - Cells that die still exist as processes (just dormant) - they can be reborn - The system gracefully handles thousands of message exchanges per frame - Each cell makes its own decisions - truly decentralized
This really showcases Erlang's strengths: massive concurrency, fault tolerance, and the actor model. It's surprisingly satisfying to watch, knowing each pixel is its own little process doing its thing.
Code: https://github.com/Tortured-Metaphor/Conways-Game-of-Life-in...
To run: `git clone` the repo, then `./life_gui_working.erl` (requires Erlang/OTP)
Would love to hear thoughts on other cellular automata that would benefit from the actor model approach!