Experimental project to test WASM and WebWorkers https://mandelbrot-wasm.web.app/
npm install
For rust, make sure you installed Rust lang, then run:
cargo install wasm-pack
cargo install wasm-snip
npm run server
then open http://127.0.0.1:8080
npm run build
The baseline implementation of the Mandelbrot set rendering
WASM has human readable text format, the file extension is usually wat
.
This format must be transformed into binary WASM
- Official site
- Specification
- Old but informative reference
- WAT ot WASM compiler
- Good step by step tutorial
AssemblyScript is a TypeScript like language what we can compile to WASM
Rust is a modern system language (like C, C++). With wasm-pack we can compile rust code to WASM
- The app works only in chromium based browsers right now
- WASM average execution time is a little slower then native JS (with the current implementation of WASM + Mandelbrot is very specific problem the engine can optimise JS very well)
- Naive hand written WASM can not beat the compiled and optimized code
- WASM not start new thread, you have to run it in webWorker for that.