Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

robertaboukhalil/wasm-chasm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Crossing the Wasm Chasm Video

Setup

(skip if you already have Emscripten installed)

# Download Emscripten container
docker pull robertaboukhalil/emsdk:1.39.1

# Create a container that exposes the container's port 80 as 12345 and mounts the current directory as /src.
# This allows you to load .html, .wasm and .js files in your browser at http://localhost:12345:
docker run \
    -dt \
    -p 12345:80 \
    --name wasm \
    --volume "$(pwd)":/src \
    robertaboukhalil/emsdk:1.39.1

# Go inside the container
docker exec -it wasm bash

Compile to WebAssembly

# Use Asyncify to address the infinite loop in this app.
# An infinite loop on the main thread crashes the browser tab
cd mandelbrot
git apply ../mandelbrot.diff

# Compile to WebAssembly (enable Asyncify and SDL2 port)
emcc -O2 -o mandelbrot.html mandelbrot.c -s USE_SDL=2 -s ASYNCIFY=1

Further Reading

About

Companion repo to the "Crossing the Wasm Chasm" video:

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published