Tutorial from https://rustwasm.github.io/docs/book/game-of-life/implementing.html
Extended to change memory from Javascript on Mouse click.
Benoît 585d2339a6 | ||
---|---|---|
src | ||
tests | ||
www | ||
.appveyor.yml | ||
.cargo-ok | ||
.gitignore | ||
.travis.yml | ||
Cargo.toml | ||
LICENSE_APACHE | ||
LICENSE_MIT | ||
README.md |
README.md
About
Tweak of the great Wasm tutorial here : [tutorials]: https://rustwasm.github.io/docs/wasm-pack/tutorials/index.html
Links
wasm-bindgen
for communicating between WebAssembly and JavaScript.console_error_panic_hook
for logging panic messages to the developer console.wee_alloc
, an allocator optimized for small code size.
Note for myself
Crée l'arborescence www
$ wasm-pack build
$ npm init wasm-app www
$ cd www/
$ npm install
Puis :
$ vim www/package.json
--
"dependencies": {
"wasm-game-of-life": "file:../pkg", // Add this line!
--
Puis :
$ vim www/index.js
--
import * as wasm from "wasm-game-of-life";
(…)
--