This book takes a hands-on, bottom-up approach: you'll go from hand crafting bytecodes to writing a real compiler for a simple programming language.
Forget the hype — get your hands dirty and see for yourself what WebAssembly is all about.
$39 $29 Beta price
This book is a work in progress. The beta price includes:
To really understand what WebAssembly is and what makes it special, you need to dive into the low-level details.
We use a hands-on approach to teach you the core of WebAssembly: the instruction set and the module format.
Since WebAssembly is primarily a compilation target, we think the best way to learn the details is by writing a compiler. (Really.)
You'll build a compiler that compiles a simple programming language down to WebAssembly.
The focus is on WebAssembly, not the finer details of parsing. The compiler is built in JavaScript, using Ohm, a user-friendly parsing toolkit.
All the code you need is provided in the book. Everything proceeds step by step — in small, logical increments.
The book is mainly targeted at experienced programmers. You don't need to be an expert, but ideally you've been programming for a few years and are fluent in more than one language. For important topics that some readers might not be familiar with, we've included optional deep dive sections to get you up to speed.
In order to understand the code, you'll need at least intermediate knowledge of JavaScript, or a willingness to learn. We try to stick to "the good parts" and to avoid any advanced or obscure features.
You do not need any previous experience with writing a compiler! Our compiler is based on Ohm, a framework that handles the lower-level details of parsing. This lets us keep the focus on WebAssembly.
For some reason, many people believe that writing a compiler is a complex, esoteric task. But we hope to convince you that it's really not.
is a co-founder of Instadeq, a data analysis and visualization product, and the creator of GlooData, a no-code automation tool. He has a long history of language- and compiler-related side projects, including the programming languages Efene and Interfix. In the past, he worked with IBM Research and on high-performance computing at Intel. Originally from Córdoba, Argentina, he now lives in Stuttgart, Germany.
is a programmer and independent researcher based in Munich, Germany. He's a co-creator and the primary maintainer of Ohm, a user-friendly parsing toolkit for JavaScript. At the beginning of his career, he spent four years working on the J9 Java VM at IBM. Since then, he's worked at companies like Google (on Chrome and Android), Lyft, and Sourcegraph.
If you're not ready to buy the book yet, you can subscribe to our mailing list and we'll let you know when the book is finished. Don't worry — it's very low traffic, and you can unsubscribe with one click.