Calculates the fibonacci number of n : Fn.
The purpose of this repo is to dive in Web Assembly and Wasmer. The implementation of this fibo is in C++ and not optimized (no multi-threading).
Or
docker run -it --name wasm --rm -v $PWD:/src robertaboukhalil/emsdk:1.38.26 bash
After you installed emscripten you should be able to build the .wasm
file:
make wasm
After the compilation, you can test the wasm binary file by typing the following command line:
node target/fibo.js 11 # should display "F(11) = 144"
Just run it with wasmer:
wasmer run target/fibo.wasm 11 # should display "F(11) = 144"
After you installed wasmer and built the .wasm
file you should be able to publish it as a package after you logged in:
wapm login
wapm publish
Just install the wasm package lhauspie/fibo
from wapm and then run it:
wapm install -g lhauspie/fibo
fibo 11 # should display "F(11) = 144"