Rust wasm: Browser games!
summary
Builds a browser Breakout clone using Rust compiled to WASM with Bevy as the engine and wasm-bindgen for JS interop; compilation needs a web-specific renderer swap (WebGL) and Cargo feature flags. Native release starts ~12.1 MB, LTO+size flags drop to ~10.4 MB, and running wasm-opt brings it down to ~5.2 MB. Notes single-threaded WASM, missing WebGPU support in browsers, limited audio/gamepad support, and that the game runs in-browser after the build and bundling steps.
AI-written summary · about
chapters (11)
- 0:00Start
- 7:10Let's talk about Rust, baby
- 9:03What do I like about Rust? / Why do I like Rust?
- 11:02Why is Rust the right tool for the job?
- 15:46Choices, choices!
- 19:54Breakout!
- 20:31What changes do you need to make when going from desktop?
- 24:55Wiring everything together
- 27:48Make the package smalle
- 32:20Post-processing with wasm-opt
- 34:09Code profiling and further tweaks
related talks
44mOut of the JavaScript Box: Front-End Rust Programming
20mUsing Rust and WASM
30mRust and the Web Platform: A Rookie’s Guide
41mLet's build with WebAssembly!
30mRust in the Browser for Javascripters:New Frontiers,New Possibilities
43mDo things blazingly fast with WebAssembly
46mA State Of WebAssembly - The Browser is now a real VM
27m“Breaking Out of Box”
