Conway's Game of Life with Rust and WebAssembly

Conway's Game of Life with Rust and WebAssembly

Published
February 1, 2024
Tags
Rust
WebAssembly
JavaScript
HTML
CSS
TOC

wasm-game-of-life
AgainstEntropyUpdated Feb 1, 2024
In this project, I followed the The Rust and WebAssembly Book and learned the following things:
  1. About Rust and WebAssembly
    1. How to set up a Rust toolchain for compiling to WebAssembly.
    2. How to debug WebAssembly modules compiled from Rust.
    3. How to time profile Rust and WebAssembly programs to make them faster.
  1. About JavaScript and npm
    1. How to do version control of npm with nvm
  1. About polyglot
    1. Interfacing Rust and JavaScript with WebAssembly
    2. A workflow for developing programs made from Rust, WebAssembly, JavaScript, HTML, and CSS.
 

Setup

Install toolchains

Rust

 

cargo-generate

 

wasm-pack

 
 

npm

 

Initialize the project

 

Implementation

 
 

Testing

notion image
 

Debugging

Could not find `console` in `web_sys`
Updated Nov 11, 2019
 
I learned how to control FPS in HTML animation from the demo below
 
I learned how to detect Ctrl+Click or Shift+Click here