How WebAssembly Works

Learn what WebAssembly is and how it works.

Traditionally, if we needed to implement any logic in the browser, we would use JavaScript. It is a powerful multi-purpose language, but it has one major drawback: JavaScript is an interpreted language, which means that it’s stored in its original form, and it gets compiled into the low-level machine instructions as it’s being read. This makes it unsuitable for applications that require high performance, such as resource-demanding video games or complex modeling software.

WebAssemblyCompiled code running in the browser (often abbreviated as WASM) is a technology that was designed to tackle this problem. It runs low-level code that easily maps to the actual machine code instructions. Therefore, it works just like any compiled executable. The diagram below outlines how WebAssembly works.

Get hands-on with 1200+ tech skills courses.