/wasm-game-of-life

Game of Life implementation using Cheerp WASM

Primary LanguageC++

Have you ever written C++ for your frontend?

This is a simple challange I took on myself.

  • Make a frontend webapp using ONLY C++.

I chose to imlement Conways game of life, a simple cellular automata with very cool emergent properties. For example, Conways Game of Life is Turing complete. Therefore, you can apparently simulate Conways Game of Life inside Conways Game of Life.

But why would you do this to yourself?

Becasue I love pain

But actually, a few reasons come to mind:

  1. Wasm is a cool new technology I wanted to learn about, and what is a better way to learn other then doing an actual project.
  2. Summer vacation is long and I wanted to keep my skills sharp (yes, I could have gone back to my project from last summer but I didn't want to).

And in the spirit of emergent properties, I wanted to use C at first as this was the last language I learned, but the compiler I used Cheerp had no C documentation. Hence

  1. I wanted to learn a bit of C++

How to run?

Compile using Cheerp wasm compiler

/opt/cheerp/bin/clang++ index.cpp -o dom.js -O3

Then use some server (I used vscode extension live server) to run index.html.