TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Lifeee – Conway’s Game of Life with an infinite zoomable grid

75 pointsby scastielover 3 years ago

14 comments

scastielover 3 years ago
Hi all! Here is the latest Rust side project I’ve been working on for the past couple of weeks: Lifeee, an implementation of John Conway’s Game of Life.<p>It was the opportunity for me to continue my Rust learning journey, and I think I’m finally starting to feel a bit comfortable with the language, especially ownership :). I also wanted to discover what was possible when using Rust for frontend development, and I must say I was so impressed by Yew! I didn’t think it would be so nice to use, especially since I have quite some experience with React.<p>A big difference compared to the various implementations you can find (often in Rust and Yew tutorials) is that the grid is infinite. This means that you can drag it to move in all directions, but also zoom in and out. This was probably the most challenging part of my project and involved a lot of calculus and doodles in my notebook! Also, since I used a canvas to draw the grid (and not DOM elements), the simulation is pretty fast even when a lot of cells are displayed :D<p>What I learned during this project:<p>- Use Yew [1] for frontend development: not very different from writing React components, with the advantages of Rust as a plus!<p>- Serialize&#x2F;deserialize data: the available Game of Life patterns are extracted from the official Lexicon [2]; I parsed the text version to generate a serialized version (separate library: [3]) that I then import and deserialize in the app.<p>- Build the web app using GitHub actions and deploy it using Netlify: pretty straightforward using Trunk [4] as a bundler (also used for development).<p>You can find the source code of the app on GitHub [5]. Please tell me what you think of it! ;)<p>[1] <a href="https:&#x2F;&#x2F;yew.rs&#x2F;" rel="nofollow">https:&#x2F;&#x2F;yew.rs&#x2F;</a> [2] <a href="https:&#x2F;&#x2F;bitstorm.org&#x2F;gameoflife&#x2F;lexicon&#x2F;" rel="nofollow">https:&#x2F;&#x2F;bitstorm.org&#x2F;gameoflife&#x2F;lexicon&#x2F;</a> [3] <a href="https:&#x2F;&#x2F;github.com&#x2F;scastiel&#x2F;lexicon-rs" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;scastiel&#x2F;lexicon-rs</a> [4] <a href="https:&#x2F;&#x2F;trunkrs.dev&#x2F;" rel="nofollow">https:&#x2F;&#x2F;trunkrs.dev&#x2F;</a> [5] <a href="https:&#x2F;&#x2F;github.com&#x2F;scastiel&#x2F;lifeee-rs" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;scastiel&#x2F;lifeee-rs</a>
hx2aover 3 years ago
Can someone tell me more about how the predefined Game of Life patterns came to be? It it fascinating to me that these have names that people remember. I know this subject is well researched, but are the researchers finding these things randomly or is there some kind of analytical approach to design patterns that are likely to have a desired result?
评论 #29225744 未加载
d_silinover 3 years ago
Another Life implementation in Rust: <a href="https:&#x2F;&#x2F;github.com&#x2F;brundonsmith&#x2F;life" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;brundonsmith&#x2F;life</a><p>And my own fork of it, with extra features: <a href="https:&#x2F;&#x2F;github.com&#x2F;DarkStar1982&#x2F;life" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;DarkStar1982&#x2F;life</a>
grodriguez100over 3 years ago
Nice. I made something very similar to this more than 20 years ago using wxWidgets. It is still included in the standard distribution as a demo:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;wxWidgets&#x2F;wxWidgets&#x2F;tree&#x2F;master&#x2F;demos&#x2F;life" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;wxWidgets&#x2F;wxWidgets&#x2F;tree&#x2F;master&#x2F;demos&#x2F;lif...</a>
plonqover 3 years ago
Nice! I also wrote my own implementation of the game of life not long ago! It’s less fleshed out, but it was a fun little project.<p><a href="https:&#x2F;&#x2F;gameoflife.plonq.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;gameoflife.plonq.org&#x2F;</a> <a href="https:&#x2F;&#x2F;github.com&#x2F;Plonq&#x2F;gameoflife" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;Plonq&#x2F;gameoflife</a>
yoru-sulfurover 3 years ago
Nice work. Funny coincidence I was just going through <a href="https:&#x2F;&#x2F;rustwasm.github.io&#x2F;docs&#x2F;book&#x2F;" rel="nofollow">https:&#x2F;&#x2F;rustwasm.github.io&#x2F;docs&#x2F;book&#x2F;</a> today, so Rust, WebAssembly, and the Game of Life was already on my mind.
teraflopover 3 years ago
Cool project!<p>&gt; the available Game of Life patterns are extracted from the official Lexicon<p>It would probably be a good idea to add the appropriate credit to the app itself, since the contents of the Life Lexicon are licensed under CC BY-SA.
评论 #29205670 未加载
hotenover 3 years ago
Awesome!<p>A feature suggestion, if I may. It&#x27;s fun to play with the rules of the game itself. Would you consider adding a way to tweak the birth&#x2F;death rules? For example, &quot;B3&#x2F;S23&quot; denotes the normal rules of the game (a cell is born if it has 3 live neighbors, and remains alive if it has 2 or 3).<p>You can play with the rules in my version of Life here[1].<p>[1] <a href="https:&#x2F;&#x2F;hoten.cc&#x2F;life&#x2F;play&#x2F;" rel="nofollow">https:&#x2F;&#x2F;hoten.cc&#x2F;life&#x2F;play&#x2F;</a>
Minor49erover 3 years ago
Simply fantastic. I love Conway&#x27;s Game of Life. This page makes it easy to observe a huge variety of creative patterns.<p>The book &quot;The Recursive Universe&quot; by William Poundstone is a fun look into the Game of Life, pairing observations and thoughts about the game with real world physics and life.
评论 #29204837 未加载
fistynutsover 3 years ago
This doesn&#x27;t work well on mobile. Once a pattern is chosen, panning and zooming is broken.
darkenover 3 years ago
Neat! The option called &quot;Bloom&quot; looked especially interesting when zoomed out.
评论 #29204372 未加载
jartover 3 years ago
This is cool. What I particularly like about it is the use of grey to show which tiles were previously occupied. One change you might want to consider is making left click free-form draw and then right click could drag the grid.
yummypaintover 3 years ago
Adding boundary conditions can be very interesting also. Ive played with things like stitching the field into a torus or klein bottle. You can end up with unique repeating patterns not otherwise possible.
smegsicleover 3 years ago
BUG: when several patterns are shown in the lexicon, it sticks them together see: garden of eden, rabbits