Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


An implementation of Conway's Game of Life based on this tutorial.

Quick Start

To start the server, enter:

git clone
cd convida/www
npm install
npm run start

Screenshot of Convida





Then, within the convida directory, enter:

wasm-pack build

to build the Rust code in src/ to the pkg directory.

Source Descriptions

File/Directory Description
Cargo.lock dependencies.
Cargo.toml dependencies. this README file.
benches used in optimizing runtime.
convida-alt.png alternative logo image.
convida.png logo image.
convida.xcf GIMP logo file. beta cross compiling script. used in optimizing runtime.
pkg destination directory for compiled rust code.
screenshot.png screenshot image.
src main source files.
target Rust's target directory.
tests used in testing ticks and created cell patterns.
www directory for web client.


Improvements on the Tutorial

  • Introduce an <input type="range"> widget to control how many ticks occur per animation frame.
  • Add a button that resets the universe to a random initial state when clicked. Another button that resets the universe to all dead cells.
  • On Ctrl + Click, insert a glider centered on the target cell. On Shift + Click, insert a pulsar.
  • At this point, the next lowest hanging fruit for speeding up Universe::tick is removing the allocation and free. Implement double buffering of cells, where the Universe maintains two vectors, never frees either of them, and never allocates new buffers in tick.


  • Implement the alternative, delta-based design from the "Implementing Life" chapter, where the Rust code returns a list of cells that changed states to JavaScript. Does this make rendering to <canvas> faster? Can you implement this design without allocating a new list of deltas on every tick?
  • As our profiling has shown us, 2D <canvas> rendering is not particularly fast. Replace the 2D canvas renderer with a WebGL renderer. How much faster is the WebGL version? How large can you make the universe before WebGL rendering is a bottleneck?
  • We only ever instantiate a single Universe, so rather than providing a constructor, we can export operations that manipulate a single static mut global instance. If this global instance also uses the double buffering technique discussed in earlier chapters, we can make those buffers also be static mut globals. This removes all dynamic allocation from our Game of Life implementation, and we can make it a #![no_std] crate that doesn't include an allocator. How much size was removed from the .wasm by completely removing the allocator dependency?


Conway's Game of Life powered by WebAssembly.






No releases published


No packages published