This repo contains examples on using rust with webassembly.
Most examples contains Makefile for compilation. Run make
to build.
Run make server
to run a local server, and open http://localhost:8000
These examples are built using emscripten v1.37.28.
Basic hello wolrd example. Output through console.
Use asmjs as compilation target, run in nodejs.
Use stdweb
crate to interact with the dom.
js and rust interop.
Showing how to use emscripten api in rust, using C extern.
Read a local file, count occurcy of each words.
Draw some basic shapes, images using sdl2. Make it run both as native and web.
A draggable box using sdl2. This demo works on both web and pc.
On web, it accepts both touch events and mouse events.
Native app can be run with cargo run
.
link
A web gallery app using sdl2 & sdl2_ttf. link
A mandelbrot example to compare perf of js and wasm. This demo works on both web and pc. link