Tutorial from https://rustwasm.github.io/docs/book/game-of-life/implementing.html
Extended to change memory from Javascript on Mouse click.
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
3 years ago | |
---|---|---|
src | 3 years ago | |
tests | 3 years ago | |
www | 3 years ago | |
.cargo-ok | 3 years ago | |
.gitignore | 3 years ago | |
.travis.yml | 3 years ago | |
Cargo.toml | 3 years ago | |
LICENSE_APACHE | 3 years ago | |
LICENSE_MIT | 3 years ago | |
README.md | 3 years ago |
README.md
About
Tweak of the great Wasm tutorial here : tutorials
Links
wasm-pack
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";
(…)
--