All Projects → gliheng → rust-wasm

gliheng / rust-wasm

Licence: MIT license
Demos of using rust with webassembly

Programming Languages

WebAssembly
147 projects
javascript
184084 projects - #8 most used programming language
HTML
75241 projects
rust
11053 projects

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.

hello-world

Basic hello wolrd example. Output through console.

asmjs

Use asmjs as compilation target, run in nodejs.

dom

Use stdweb crate to interact with the dom.

ffi

js and rust interop.

emscripten-api

Showing how to use emscripten api in rust, using C extern.

file-read

Read a local file, count occurcy of each words.

sdl2-basic

Draw some basic shapes, images using sdl2. Make it run both as native and web.

sdl2-drag

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

sdl2-gallery

A web gallery app using sdl2 & sdl2_ttf. link

sdl2-mandelbrot

A mandelbrot example to compare perf of js and wasm. This demo works on both web and pc. link

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].