WebAssembly Resources

I went to an interesting WebAssembly meetup at Mozilla. (I think they will post the video on the meetup page later.)

WebAssembly is supported in the latest browsers already and is worth checking out.

One demo at the meetup involved compiling an image manipulation library that was written in C (possibly libjpeg?) to WebAssembly and then resizing images in the browser with it. :exploding_head:

https://developer.mozilla.org/en-US/docs/WebAssembly

Here’s a quick tutorial using this WasmExplorer.

It looks like it’s even possible to convert WebAssembly to JavaScript for browsers that don’t support WebAssembly.

If anyone is looking for resources, here are a couple of books:

2 Likes

I went to another WebAssembly meetup last night at Cloudflare.

It looks like a great time to get into this technology. Opportunities for early adopters including porting existing programs to wasm. Examples are ImageMagick and Vim (demo).

The author of Level Up With WebAssembly gave one of the presentations, and it looks like his book has a section on porting C code to wasm.

Cloudflare did a live coding demo of writing a program in Go, compiling it to wasm, and then deploying it as a Cloudflare cloud function (wasm on the server). If I understood correctly, the startup time for a wasm function can be 100 times faster than for a node function (5ms vs. 500ms).

Laurie Voss (co-founder of npm) gave a presentation on the future of npm and WebAssembly. Here are some of the links that were mentioned:

  • tink – "tink acts as a replacement for Node.js itself, working from your existing package-lock.json ."
  • https://webassembly.js.org/
  • walt – “Walt is a JavaScript-like syntax for WebAssembly text format”
  • wasm-pack – “rust -> wasm workflow tool”
  • binaryen.js – “a port of Binaryen to the Web, allowing you to generate WebAssembly using a JavaScript API.”

Some other mentioned links that people might want to investigate:

I hope they post the video online. Check the event page if I forget to update this post later. :slight_smile:

I don’t have much free time between meetups at the moment, but if anyone wants to work through one of the WebAssembly books (C/C++ or Rust) during our Wednesday meetups, leave a comment here or send me a message. I think WebAssembly is about to become the next big technology, and demand for people who know it is probably just around the corner. :rocket:

2 Likes

Here are some more resources – I haven’t looked closely at them yet:

Free

Non-free

From the Cloudflare meetup:

Also data science in the browser and WebAssembly on the server.

Here’s the YouTube channel for that meetup group:

I didn’t look closely yet, but it looks like DOM access for WebAssembly.

And building a web application completely in Rust:

A project from Mozilla’s blog: A system interface to run WebAssembly outside the web

Today, we announce the start of a new standardization effort — WASI, the WebAssembly system interface.

Why: Developers are starting to push WebAssembly beyond the browser, because it provides a fast, scalable, secure way to run the same code across all machines.

But we don’t yet have a solid foundation to build upon. Code outside of a browser needs a way to talk to the system — a system interface. And the WebAssembly platform doesn’t have that yet.

What: WebAssembly is an assembly language for a conceptual machine, not a physical one. This is why it can be run across a variety of different machine architectures.

Just as WebAssembly is an assembly language for a conceptual machine, WebAssembly needs a system interface for a conceptual operating system, not any single operating system. This way, it can be run across all different OSs.

This is what WASI is — a system interface for the WebAssembly platform.

Edit: two more resources:

I haven’t looked closely at it, but here’s another tutorial:
https://wasmbyexample.dev/

I watched half of the videos in that course, and it’s good so far. It shows how to compile C code to run in the browser, first from scratch (with small, manual edits to the wat format) and then with Emscripten.