This is on my todo list this weekend. Using WABT (github.com/WebAssembly/wabt) create a WebAssembly Binary for my Conway's Game of Life calculation, and see how much faster it can be in WASM vs plain Js.
More or less my plan is to create a WAT file (a textual representation of a WASM binary) use the WABT's wat2wasm tool to create the module, and then call that module in my current Game of Life implementation.
There are other ways to compile to WASM, but using WABT seemed the most friendly initially, because I don't know much about C, C++, or Rust.
I was unable to effectively call web assembly to make my Conways Game of life faster. I got to the point where i could create a WASM binary and could call the binary in JS, but learning WAT to create the modules was a lot, especially to do anything meaningful.
I then looked into using other tools to compile WASM binaries, namely AssemblyScript. I had trouble creating the binaries because there is (or was) a bug preventing it from working on my version of windows. I never got around to setting everything up on my Linux machine to continue exploring WASM, because life got in the way.
I know there are some blog posts around that have recreated Conways Game of life in WASM. Still havent seen what the performance improvement would be.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
This is on my todo list this weekend. Using WABT (github.com/WebAssembly/wabt) create a WebAssembly Binary for my Conway's Game of Life calculation, and see how much faster it can be in WASM vs plain Js.
More or less my plan is to create a WAT file (a textual representation of a WASM binary) use the WABT's wat2wasm tool to create the module, and then call that module in my current Game of Life implementation.
There are other ways to compile to WASM, but using WABT seemed the most friendly initially, because I don't know much about C, C++, or Rust.
Could you share your conclusions with us?
I was unable to effectively call web assembly to make my Conways Game of life faster. I got to the point where i could create a WASM binary and could call the binary in JS, but learning WAT to create the modules was a lot, especially to do anything meaningful.
I then looked into using other tools to compile WASM binaries, namely AssemblyScript. I had trouble creating the binaries because there is (or was) a bug preventing it from working on my version of windows. I never got around to setting everything up on my Linux machine to continue exploring WASM, because life got in the way.
I know there are some blog posts around that have recreated Conways Game of life in WASM. Still havent seen what the performance improvement would be.