The Definitive Guide is a thorough and accessible introduction to one of the most transformative technologies hitting our industry. What started as a way to use languages other than JavaScript in the browser has evolved into a comprehensive path toward portability, performance, increased security, and greater code reuse across an impressive collection of deployment targets. Author Brian Sletten introduces elements of this technology incrementally while building to several concrete, code-driven examples of practical, cutting-edge WebAssembly uses. Whether you work with enterprise software or embedded systems, or in entertainment, scientific computing, or startup environments, you'll learn how WebAssembly can have a positive impact on the way you develop software.
If you want to understand Webassembly (aka wasm) and why it will likely have a big impact in the years to come, read this book. Don't expect to come away from it as a wasm expert. I don't think a book could really get you there and any that tried would be out of date in six months. But this book can help you understand the landscape. No matter what, if you want to understand wasm, you'll have to go beyond what's in this book, but it can help set a solid foundation to build on and understand what you're seeing as you dig in.
A couple things to note:
1. You can likely skip a few of the later chapters. They're not all essential to get the key ideas, but reading up through chapter 12 is likely to be worthwhile if you want to get the full big picture view. It might seem like the chapter on Rust is superfluous, at first glance, but the reality is that the current state of the wasm world is very, very heavily dependent on Rust, so getting basically familiar with it and how it can be leveraged in the wasm world is likely to pay off. Frankly, getting more comfortable with Rust was already on my radar for a while, but having read this and wanting to closely track the developments in this space have bumped it to the top of my list for 2023.
2. Don't expect everything in the book to be up to date. The wasm world is moving quickly and I found some of the examples didn't work as shown, but that's to be expected. It's possible some of these were genuine mistakes, but I'll give the author and reviewers credit for checking things during the editing process. Check out author's GitHub repo for the book and you can find the latest code: https://github.com/bsletten/wasm_tdg.
I really liked this book. The writing style is informal enough that it removes the stuffiness of writing about such a low level topic. The first few chapters give a thorough explanation of the technical basis for Webassembly as well as an introduction to the tools that let a developed "disassemble" their software. The rest is a bit of a survey about Webassembly as it's actually used which I found enjoyable but not nearly as practical. The chapter that introduces Rust does an excellent job at giving a flavor of the language in only a few pages.
Not only is this book comprehensive, it is necessarily so. Webassembly is a transformative technology that connects and builds upon a great deal of work that has been taking place over the past several years. As a practitioner who hopes to leverage webassmbly in the future, this book has provided a crucial foundation to fuel my future work. The author of this work has communicated the key ideas, built upon them, and connected them in a single, definitive work without overwhelming the reader. Having read this book cover-to-cover I found it extremely well structured--introducing just enough of each concept, just in time--building to a clear and exciting vision for the future. Beyond this, I found the book a joy to read from start to finish. I wish more books like this existed.
"Surface-level" learning is endemic in our industry. I do not believe this is necessarily a bad thing when used strategically--in fact it is often necessary for developers to get up to speed with a particular tool or framework quickly in the face of an onslaught of technological change and advance. What is worrying, however, is it is increasingly becoming the de-facto standard of technology writing and training. There are times where mere "surface-level" education is not only insufficient, but robs the reader of the full context and understanding necessary to truly leverage some technological advances. I am extremely grateful the author has taken the challenge to produce this work.
To the reader, who wants a deeper understanding of what this technology is, its possibilities, and how we got here; this is the book for you. I will strongly recommend this to anyone interested in this area, and I feel privileged to have this work in my library. I am very grateful to the author for taking this refreshingly comprehensive approach to webassembly.
Three-and-three-quarters stars. There's a lot to like in this books, and there are some limitations.
Pros: - The author is knowledgeable and enthusiastic; - The writing is clear and comprehensible; - Installation instructions are brief and in an appendix, and don't clutter the actual text; - Lots of examples, with explanations: - The book covers what WebAssembly is, why you would use it, and how you would do it; - It gives the highest level of detail to the most basic (in the sense of underlying) parts, while getting less detailed when getting more general. - It covers the underlying structures and memory model of WebAssembly; - It gives examples of use of the most common tools for WebAssembly; - It tries to give an overview of the entire WebAssembly ecosystem as of the time of writing.
Cons: - It's been out only a year, and parts of it are already out of date; - There is no official errata even though some of the examples will no longer run (although it is easy enough to figure out what is wrong, user submitted errata contains solutions); - In the print edition, many of the screen shots are hard to read due to small size and lack of color; - The later (higher level) chapters have a tendency to become very dense and full of references; - The author is very enthusiastic, which results in a perhaps inadvertently condescending beginning of the Rust chapter, and a honestly unnecessary (and unconvincing) chapter on WebAssembly and Decentralized Applications.
This book seems to be currently the most recent general book on WebAssembly.