
WebAssembly
WebAssembly is a format for programs that runs in the browser nearly as fast as software installed directly on the operating system. It complements JavaScript and makes computationally intensive applications such as video editing, 3D games, or AI models possible directly in the browser.
A browser natively understands only a single programming language: JavaScript. JavaScript is flexible, but often too slow for demanding computations. WebAssembly is a second format that browsers have understood since 2017. It is not a replacement for JavaScript, but a complement for tasks where speed matters. Programs written in other languages — such as C++, Rust, or Python — can be compiled into WebAssembly and then run in the browser. The result runs significantly faster than comparable JavaScript code, because the browser has less work to do when converting it into machine code.
WebAssembly as a gateway to demanding browser applications
Previously, software had to be installed if it was computationally intensive. Video editing, 3D simulations, or running an AI model were barely conceivable in the browser. WebAssembly shifts this boundary. What once required a desktop application can now run in the next tab over.
This has a practical advantage: users don’t download anything, don’t install anything, and don’t need administrator rights. The application opens like a webpage. For developers, it means they don’t have to rewrite existing code in C++ or Rust — they simply compile it to WebAssembly.
Security is not an afterthought here. WebAssembly runs in the same sandboxed environment as JavaScript — a so-called sandbox. So the program cannot simply access files on your computer, even though it can theoretically achieve the performance of a desktop app.
From source code to a Wasm file
WebAssembly is not source code that developers write directly. It is a target format — similar to a translated edition of a book that originated from an original in another language. A developer, for example, writes their code in Rust, and a translator program, the so-called compiler, converts it into a Wasm file. This file contains instructions in a compact, binary format.
The browser loads this file and translates it one final time — this time into the concrete instructions that the processor of the respective device understands. This last step is very fast, because Wasm files are already structured so that the translation requires hardly any effort. JavaScript, on the other hand, must first be analyzed, optimized, and then translated by the browser, which takes more time.
A common misconception: WebAssembly does not replace JavaScript. Both work together in the browser. JavaScript typically handles the user interface and the page’s logic. WebAssembly handles the computationally intensive part in the background — for example, decoding a video or calculating a physics simulation.
WebAssembly in products and headlines
Adobe has released Photoshop as a browser version. The core of the image editing runs in WebAssembly — the same C++ codebase that powered the desktop app for decades, compiled for the browser. Figma, a design tool familiar to many pupils and students, also uses WebAssembly for its rendering engine.
In the field of AI, WebAssembly is increasingly appearing when it comes to running small models directly in the browser without sending data to a server. This is privacy-friendly and even works offline. Projects like Google's MediaPipe use this approach for real-time face detection or hand tracking directly in the webcam app.
Outside the browser, WebAssembly is growing as well. Under the name WASI — WebAssembly System Interface — Wasm code also runs on servers and embedded systems. The advantage is the same as in the browser: a single Wasm program runs on any operating system without modification. This makes it a serious topic in cloud infrastructure.