Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/flexwilliams/rustwasm-game-of-life-sveltekit
https://github.com/flexwilliams/rustwasm-game-of-life-sveltekit
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/flexwilliams/rustwasm-game-of-life-sveltekit
- Owner: FlexWilliams
- License: mit
- Created: 2023-12-30T00:53:40.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-01-06T18:39:02.000Z (about 1 year ago)
- Last Synced: 2024-04-28T06:15:04.959Z (9 months ago)
- Language: Rust
- Size: 182 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# rustwasm - Conway's Game of Life (w/SvelteKit)
Implementing the [rustwasm tutorial](https://rustwasm.github.io/docs/book/game-of-life/introduction.html) of Conway's Game of Life using [SvelteKit](https://kit.svelte.dev/) as the UI.
## Development
- Using [pnpm](https://pnpm.io/) as package manager
- Node v20
### Running
Install web dependencies:
```
pnpm install
```Compile the wasm package via:
```
pnpm wasm
```Run the development server:
```
pnpm dev
```
Visit: [http://localhost:5173](http://localhost:5173)
### Takeaways/Learnings/Links
1. wasm-bindgen - allows JS/wasm to communicate with strings, JS objects, classes, etc, as opposed to purely integers and floats.
1. Ex. https://rustwasm.github.io/wasm-bindgen/print.html#srclibrs-1
2. wasm-pack vite-plugin: https://github.com/nshen/vite-plugin-wasm-pack
3. Getting { memory } module to load since now using the `no bundler` strategy. See link below (kudos!):
1. https://lionturkey.github.io/posts/rustwasm/rustwasm.html
2. "In order to access memory used by Wasm without npm, we need to save the output of the init() function"### Future TODOs:
1. Implement [Hashlife](https://en.wikipedia.org/wiki/Hashlife)