Trying out Rust with Bevy and WebAssembly

Wed, February 18, 2026

W
R
A
S
D
SPACE
Or if you are on your mobile, you can swipe to the direction you want it to go!

What you see inside the box above is a simple game compiled from Rust to WebAssembly. It took me days to figure out how to make it work, but I finally did it! Even the snake game logic is interesting, I might use it to interview candidates in the future!

We all heard about Rust at this point. As of writing, I'm on career break. Why not try learning a new programming language eh? So I started reading The Rust Programming Language book (I'm far from done!).

Why WebAssembly? Why not just plain old JavaScript?

Portability... Some famous applications that you are using in your browser are probably compiled to WebAssembly. Figma, Adobe Photoshop, Zoom, and probably even Microsoft Excel (I just checked it now, yes, they indeed use WebAssembly) is compiled to WebAssembly. These applications were probably compiled from C++ or any high-performance programming language, why not just port it to browsers? Even some old games are being compiled to WebAssembly including Doom, Starcraft, and Quake.