Web Assembly (Wasm)

Jem Young

Jem Young

Netflix
3 hours, 43 minutes CC
Web Assembly (Wasm)

Course Description

Build and compile modules from any language to the web in this beginner-friendly introduction to Web Assembly! In this course, you'll learn foundational, low-level programming such as binary, hexadecimal, and all about how memory works within computers. By the end, you'll have dived into array buffers, memory management, and unsigned integers, as well as created Web Assembly modules with AssemblyScript.

This course and others like it are available as part of our Frontend Masters video subscription.

Preview
Close

Course Details

Published: April 7, 2021

Learn Straight from the Experts Who Shape the Modern Web

Your Path to Senior Developer and Beyond
  • 200+ In-depth courses
  • 18 Learning Paths
  • Industry Leading Experts
  • Live Interactive Workshops
Get Unlimited Access Now

Table of Contents

Introduction

Section Duration: 18 minutes
  • Introduction
    Jem Young is a Senior Software Engineer at Netflix and co-host of the Frontend Happy Hour podcast. The Web Assembly course will cover coding topics including binary, assembly, and higher-level languages like JavaScript.
  • Why Web Assembly
    Jem explains that Web Assembly works in tandem with JavaScript because it allows languages like C and Rust to be compiled into a language the browser can understand. Questions about utilizing JavaScript APIs in Web Assembly and Web Assembly's similarities to other assembly languages are also covered in this segment.

Basics

Section Duration: 41 minutes
  • Binary Overview
    Jem introduces the "bit" which is the smallest unit of information in computing. A group of eight bits is called a byte. Some computer architectures read bytes from right to left, or little endian. Others read bytes from left to right, or big endian.
  • Hexadecimal
    Jem explains hexadecimal is often referred to as machine code. Hexadecimal is an intermediate step between high-level programming languages and binary because it's concise enough for machines to interpret but easier than binary for programmers to read. In response to a student question, the process of accessing information from the register by a CPU is also explained in this segment.
  • Convert Hex & Binary with toString
    Jem demonstrates how the toString method in JavaScript can be passed an optional parameter called a radix which represents the base value for converting numbers to binary, decimal, or hexadecimal. The prefix "0x" is used to write hexadecimal values.
  • Memory
    Jem describes memory as a giant warehouse full of storage bins. Each bin has an address and can store anything as long as it fits within the bin. The main job of the operating system on a computer is to allocate and deallocate the use of these storage bins.
  • Numeric Types
    Jem explains the two main numeric types in programming are floating point and integer. In JavaScript, all numbers are represented as 64-bit floating point numbers. Web Assembly uses 32-bit memory pointers.

Web Assembly

Section Duration: 33 minutes

AssemblyScript

Section Duration: 1 hour, 51 minutes

Wrapping Up

Section Duration: 18 minutes
  • JavaScript Versus Web Assembly
    Jem uses a code example that checks if a number is prime to compare the performance of Web Assembly to JavaScript. In most cases Web Assembly has better performance, however, when dealing with complex data structures, programmers may find better performance in JavaScript or by using the Web Workers API.
  • Wrapping Up
    Jem concludes the course by sharing some resources and example applications that use Web Assembly. Questions about file watchers and supported programming languages are also answered in this segment.

Learn Straight from the Experts Who Shape the Modern Web

  • In-depth Courses
  • Industry Leading Experts
  • Learning Paths
  • Live Interactive Workshops
Get Unlimited Access Now