What is WASM?
James+Stephen
What is WASM?
Once upon a time, the big brothers of the browser world—Firefox (Mozilla), Chrome (Google), Edge (Microsoft), and Safari (Apple)—sat down together and asked: Can we create a technology to speed up games on the web?
The answer was WASM.
WASM, or WebAssembly, is a machine-independent, neutral language that runs on a virtual machine. All the major browsers—Firefox, Chrome, Edge, and Safari—support running this virtual machine inside a secure sandbox.
On these platforms, it’s pretty straightforward to compile code. You can simply run a command like:
emcc run.c -o run.wasm
Then, you copy the resulting WASM binary into the browser’s virtual machine using JavaScript and load it up. Once loaded, the WASM code runs at around 80% of the speed of native C executables, which is about 3 to 5 times faster than JavaScript. Back in 2017, that was a huge deal for web games.
Fast forward a few years, and this tech has matured a lot. It’s not just about games anymore. The video processing industry, encryption tools, and any field that demands high CPU or RAM performance have started embracing WASM for serious speed gains.