Let's play with Web Assembly
Links
Web Assembly
Hand-crafted WebAssembly Demos from Ben Smith
Steps
fibonacci.wat
wasm file is available
on github
.
☑
Wrote HTML and JS to check how they interact
☑
Get the result from wasm
☑
Start by implementing Fibonacci in wasm
☑
Before looking canvas we will look how to exchange data from memory because it will be usefull when playing with canvas
☐
Look at canvas
Demos
Fibonacci Sequence
-> Fibonaci(
0
) =
0
[debug] f(
?
) =
?
, f(
?
) =
?
Click to get the next Fibonacci sequence number
Canvas
☑
Create canvas
☑
Draw something from JS
☑
Fill the canvas from WASM
☑
Make the color depend on Fibonacci(N)
☐
Add interactivity
...and do more fun things