Preface
Delivering high-performance applications is a nightmare. JavaScript is a dynamically typed language. Thus, the JavaScript engine assumes the type when executing JavaScript. These assumptions lead to unpredictable performance. This makes it even harder to deliver consistently high-performance applications in JavaScript.
WebAssembly provides a way to run type-safe and high-performance applications in the JavaScript engine.
WebAssembly is blazingly fast
WebAssembly is the next great thing that happened in the web. It promises high and consistent performance with maintainable code, running native code and providing near-native performance on the web.
WebAssembly is type-safe
The JavaScript compiler struggles to provide high performance when you have polymorphic JavaScript code. WebAssembly, on the other hand, is type-safe (or monomorphic) at compile time. This not only boosts performance but also greatly reduces runtime errors, which is a win-win.
WebAssembly runs your native code
There have been multiple attempts to make the web faster by running native code. But they all failed because they are either vendor-specific or tied to a single language. The web is built on top of open standards. By being an open standard, WebAssembly makes it easy for all companies to adopt and support it. WebAssembly is not a language; it is a high-level implementation plan for other languages that compile to byte code that will run on the JavaScript engines.
WebAssembly is byte code
WebAssembly is nothing but a bytecode that runs in JavaScript Engine. In this book, we will learn how to convert native code into WebAssembly and how to optimize it to get even better performance. We will also cover how the entire WebAssembly runs on the JavaScript engine and how to use the various tools available and what they help us to achieve.
Most importantly, learn where and how to use WebAssembly to get the desired result out of it.
Let's make the web even more awesome and faster with WebAssembly.