Copyleft Games

Intro to WebAssembly

This task is intended to introduce you to compiling code to run on the web using WebAssembly. For this you'll use a toolchain based on Emscripten, Rust, and Cargo.

First install Emscripten and Apache HTTPd on your computer. Test this by compiling one of the emscripten examples and test it using http://localhost/

Next install Rust and use "rustup target add wasm32-unknown-emscripten --toolchain nightly" to add support for compiling to Emscripten+WebAssembly.

Next you'll need some code to compile. Use our code from Intro to OpenGL (with or without your modifications, depending on whether you've done that task already).

If everything is setup correctly, you should be able to run "cargo build --target wasm32-unknown-emscripten". Upload a zipfile (.zip or .tar.bz2) containing the files necessarily to host this on the web from target/wasm32-unknown-emscripten.

Task tags

  • html
  • rust

Students who completed this task

kamiltokarski, Sgrat, anishagnihotri, quiet, Ahmed

Task type

  • assessment Outreach / Research

Level

Beginner
close

2018