Skip to content

gyng/wasm-experiments

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

wasm experiments

Experiments in wasm with C and Rust. Factorial is slower, but counting bits is faster.

Usage

Rust

# Install
curl https://sh.rustup.rs -sSf | sh
rustup install stable
rustup default stable
rustup target add wasm32-unknown-emscripten

# Compile
rustc --target=wasm32-unknown-emscripten fact_rs.rs -O -o fact_rs.html

C

From MDN

# Install
git clone https://github.com/juj/emsdk.git
cd emsdk

./emsdk install --build=Release sdk-incoming-64bit binaryen-master-64bit
./emsdk activate --global --build=Release sdk-incoming-64bit binaryen-master-64bit

# Compile
emcc fact_c.c -s WASM=1 -O2 -o fact_c.html

References

About

Experimenting with C and Rust to WebAssembly

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published