WebAssembly Fundamentals / Chapter 1 — How It Works (lessons 1–5) / Lesson 1

What Is WebAssembly?

Time needed: about 5 min (estimate)

☆ Read later

You can try the opening of this lesson without an account.

Machine code that runs in the browser

WebAssembly (wasm for short) is a compact, fast machine-code format for running in browsers. Compile a program written in C, C++, Rust, Go, and so on to wasm, and it runs in the browser alongside JavaScript. It doesn't replace JavaScript; it's JavaScript's partner for heavy computation and for bringing in programs written in other languages.

In fact, this site uses it. The editor in the Python courses runs on Pyodide, which is the Python runtime itself (CPython) compiled to wasm. The SQL editor is sql.js, SQLite compiled to wasm. Python and SQLite run inside your browser without anything being sent to a server.

Where WebAssembly is used

Examples of where it's used serious apps in the browser Figma (design), Photoshop on the web, Google Earth runtimes for other languages Pyodide (Python), sql.js (SQLite), Ruby, PHP outside the browser edges like Cloudflare Workers and Fastly, plugins, blockchains
editor.js

Tab indents. To leave the editor, press Esc, then Tab.

Create a free account to keep reading

With an account you can read the rest of this lesson, take the quiz, and read every free lesson in this course. Lessons you answer correctly are recorded as complete.

Report a problem with this lesson

Log in to send a report.

Keyboard shortcuts

Keys available in a lesson
KeyAction
[ or Alt + ←Go to the previous lesson
] or Alt + →Go to the next lesson
?Open this list
EscClose this list

The keys do not work while the cursor is in a code editor or an input field.