WebAssembly in Action

Author of the book "WebAssembly in Action"
Save 40% with the code: ggallantbl
The book's original source code can be downloaded from the Manning website and GitHub. The GitHub repository includes an updated-code branch that has been adjusted to work with the latest version of Emscripten (currently version 3.1.44).

Saturday, August 29, 2020

WebAssembly in Action is Manning's Deal of the Day

"WebAssembly in Action" is 50% off today (August 29th, 2020) as part of Manning’s Deal of the Day.

Use code dotd082920au at https://bit.ly/2ECq0zt

Monday, August 24, 2020

Using WebAssembly modules in C#

An article showing you how your C# code can load and use a WebAssembly module via the Wasmtime runtime for .NET. It also covers how to create custom model validation with ASP.NET Core MVC.
In my book "WebAssembly in Action", I showed you how to use an Emscripten-generated WebAssembly module in the browser and on the server in Node.js.

I briefly talked about the WebAssembly System Interface (WASI) whose aim is to create a standard approach to running WebAssembly modules outside the browser in a safe way.

There were a lot of exciting things being worked on with WASI at the time but, unfortunately, it wasn't until after the book went to production that an early preview of the Wasmtime runtime was announced for .NET Core.

Today I'm pleased to announce that I wrote an article to show you how your C# code can load and use a WebAssembly module via the Wasmtime runtime for .NET. It also covers how to create custom model validation with ASP.NET Core MVC. https://platform.uno/blog/using-webassembly-modules-in-c/



Additional Material on WebAssembly

Like what you read and are interested in learning more about WebAssembly?
  • Check out my book "WebAssembly in Action"

    The book introduces the WebAssembly stack and walks you through the process of writing and running browser-based applications. It also covers dynamic linking multiple modules at runtime, using web workers to prefetch a module, threading, using WebAssembly modules in Node.js, working with the WebAssembly text format, debugging, and more.

    The first chapter is free to read and, if you'd like to buy the book, it's 40% off with the following code: ggallantbl

  • Blazor WebAssembly and the Dovico Time Entry Status app

    As I was digging into WebAssembly from a C# perspective for an article that I was preparing to write, I decided to use some research time that my company gave me to dig into Blazor WebAssembly by rewriting a small Java application that I built in 2011.

    This article walks you through creating the Dovico Time Entry Status app using Blazor WebAssembly.

  • WebAssembly threads in Firefox

    My book shows you how to use WebAssembly threads but, at the time of its writing, they were only available in Firefox behind a flag. They're no longer behind a flag but Firefox has added a requirement: To enable the SharedArrayBuffer, you need to include two response headers.

    Although the headers are only required by Firefox desktop at the time of this article's writing, this will soon change as Chrome for Android will require the headers when version 88 is released in January 2021. Chrome desktop is expected to require the headers by March 2021.

    This article walks you through returning the response headers and using WebAssembly threads to convert a user-supplied image to greyscale.

  • Using the import statement with an Emscripten-generated WebAssembly module in Vue.js

    Over the 2019 Christmas break, I helped a developer find a way to import an Emscripten-generated WebAssembly module into Vue.js. This article details the solutions found.

Tuesday, August 18, 2020

The "WebAssembly in Action" GitHub Repository


Last week, I created a GitHub repository for the original code from my book "WebAssembly in Action".

One of the tools used in the book is the Emscripten toolkit and, when the book went to print, the version used by the book was 1.38.45. Because the toolkit it constantly being improved, some of the items shown in the book need to be adjusted if you want to use a more recent version of Emscripten.

I updated the liveBook version of my book with comments explaining the workarounds when things needed to be adjusted but it didn't feel like enough.

Over the past week, whenever I could find a spare moment, I updated the original code to work with the latest version of Emscripten. Today I'm pleased to announce that the GitHub repository now has an updated-code folder with the book's code adjusted to work with Emscripten 2.0.0!

If you're interested, the GitHub repository for "WebAssembly in Action" can be found here: https://github.com/cggallant/WebAssembly-in-Action