Skip to main content
The cyberduck’s pond

šŸ§¬ WASM game of life

·

I like cells šŸ¦  #

As a developer, I have always been drawn to the complexity and beauty of cellular automata. The simple rules that govern these systems can result in rich and fascinating patterns and behaviors.

I often use cellular automata as a basis for learning new things, I have implemented them in many different languages and frameworks, I even implemented an encryption algorithm based on cellular automata early in my developer journey. This time I decided to make an efficient game of life implementation that runs in the browser to learn Rust and WebAssembly.

Cutting edge blazingly fast tech stack šŸš€ #

WebAssembly (Wasm) is a low-level, portable binary code format that is designed to be executed in modern web browsers. It was developed to allow developers to build web applications that are faster and more efficient than those built with traditional JavaScript.

Rust is well suited to compile to WebAssembly and is a language that is designed to be fast and efficient. It can be used to build high-performance applications that require a lot of computational power, such as games and simulations.

The combo Rust/Wasm is therefore ideal for building a high-performing game of life implementation that runs in the browser. The giant size option of the simulation would be difficult to run in JavaScript especially because of memory.

I also used egui rust graphic library as it can easily be compiled to WebAssembly and embedded in a web page.

You can click on cells to toggle the state
Life level changes the amount of living cells in the random generation, 0 start blank

look at the code! šŸ¤“ #

@coincoingit repo.