WebAssembly with Rust
$29.99
Minimum price
$30.00
Suggested price

WebAssembly with Rust

Create Applications with Rust and WebAssembly

About the Book

The book is written in a cookbook style. Each recipe focuses on a concept in the WebAssembly world.

Part 1 focuses on the basics of WebAssembly, WebAssembly Text Format, onboarding and using various tools like WABT, Binaryen.

Chapter 1 gives a brief introduction to LLVM. What it is and how to use it.

Chapter 2 introduces you into the `emscripten` world. Emscripten is a toolchain that helps to convert C/C++ into WebAssembly module. We will see how to install and manage the emscripten toolchain. Create our first WebAssembly module and run it on the browser and Node environment.

Chapter 3 explores the WebAssembly module, how the module is made and what are the different sections. We will also explore the WebAssembly Text Format and how to write WebAssembly Text Format and convert it to WebAssembly binary.

Chapter 4 explores how to install and use WebAssembly Binary Toolkit (WABT).

Chapter 5 explores various section inside the WebAssembly binary and what are its purpose.

Chapter 6 explores how to install and use Binaryen.

Part 2 focuses on converting Rust to WebAssembly for fast, reliable code to run on the JavaScript Engine. Find out various ways of sharing data between Rust and WebAssembly. Explore how to use various tools that Rust and WebAssembly ecosystem provides.

Chapter 7 starts with Rust and various ways to convert Rust into WebAssembly module and ends with wasmbindgen.

Chapter 8 focuses on how wasm bindgen along with crates like js-sys, web-sys helps to share entities from the WebAssembly world to JavaScript world.

Chapter 9 explores wasm-pack and how it makes it easy to build Rust and WebAssembly application.

Chapter 10 explores some Rust and WebAssembly examples.

Finally,

Chapter 11 briefly introduces WebAssembly System Interface (`WASI`) and various ways to run WASI.

About the Author

sendilkumarn
sendilkumarn

Polyglot developer who likes to choose the right tool for the right job. I admire concise, readable code. I am passionate about open source. It is a decentralized place to learn and evolve.

Table of Contents

  • Introduction
  • LLVM
    • Compiled Languages
    • LLVM in action
  • Emscripten
    • Setting up Emscripten
    • Hello world with Emscripten in Node
    • Hello world with Emscripten in Browser
    • EMSDK other options
    • Optimisations
  • WebAssembly
    • WebAssembly Module
    • WebAssembly Text Format
  • WebAssembly Binary Toolkit (WABT)
    • Getting Started with WABT
    • WAST to WASM
    • WASM to WAST
    • WASM to C
    • wast2json
    • wasm-objdump
    • wasm-strip
    • wasm-validate
    • wasm-interp
  • Sections in WebAssembly Module
    • Imports and Exports
    • Globals
    • Start
    • Memory
  • Binaryen
    • Binaryen Installing & Using
    • wasm-as
    • wasm-dis
    • wasm-opt
    • wasm2js
  • Getting Started with Rust and WebAssembly
    • Introduction
    • Installing Rust
    • Rust to WebAssembly via emscripten
    • Rust to WebAssembly via Cargo
    • Installing wasm-bindgen
    • Rust to WebAssembly via wasm-bindgen
  • Boundary Crossing between Rust and WebAssembly
    • Sharing Classes from Rust to JavaScript
    • Sharing Classes from JavaScript to Rust
    • Calling JSAPI via WebAssembly
    • Calling Closures via WebAssembly
    • Importing the JavaScript function into Rust
    • Calling webAPI via WebAssembly
  • Build, Pack
    • Bundle WASM with Webpack
    • Bundle WASM with Parcel
    • Introducing wasm-pack
    • Pack & Publish with wasm-pack
  • Advanced Rust and WebAssembly
    • Minimise WebAssembly Modules
    • Memory model in WebAssembly
    • Analysing WebAssembly Module with Twiggy
  • WebAssembly System Interface
    • wasmtime - runtime for WebAssembly
    • wasmtime - various options
    • Errors to note in WASI
    • Lucet - the WebAssembly Compiler

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.

You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!

So, there's no reason not to click the Add to Cart button, is there?

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earnedover $14 millionwriting, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub