Logo
Logo
Home
Archive
AI Agent Notes
Advertise
YouTube
Login
Sign Up
Logo
  • Home
  • Posts
  • 🦥The Future of Web Development?: Web Assembly (WASM)

🦥The Future of Web Development?: Web Assembly (WASM)

Aug 27, 2024

In partnership with

Hello friends!

Welcome to this week’s Sloth Bytes.

Ancient sloths were the size of elephants.

Today, sloths are about the size of a dog. But ancient sloths, known as Megatherium, could grow to be the same size as Asian elephants. Unfortunately, they went extinct around 10,000 years ago.

WebAssembly (WASM)

What is WebAssembly?

WebAssembly (Wasm) is a portable binary instruction format and compilation target for a stack-based virtual machine. It was designed to run efficiently on the web, but it is not limited to browsers; Wasm can also run in servers, command-line runtimes, embedded environments, and inside larger applications.

Why WASM Matters:

  • Performance potential: Wasm is compact and designed to compile efficiently to native machine code, which can make it a great fit for compute-heavy workloads. “Wasm = automatically faster than JavaScript” is not a rule—measure your actual workload.

  • Portable compilation target: Languages and toolchains such as C/C++, Rust, Go, C#, and others can target Wasm, although language/runtime support varies.

  • Works with JavaScript: In browsers, Wasm usually complements JavaScript and Web APIs rather than replacing them.

  • Works outside browsers too: Non-web runtimes can embed Wasm directly, and WASI provides standards-track interfaces for capabilities such as files, clocks, randomness, and networking.

Key Features:

  1. Compact binary modules designed for efficient validation, compilation, and execution

  2. A portable, language-neutral compilation target

  3. An open web standard with browser and non-browser embeddings

  4. Sandboxed execution where host capabilities are exposed explicitly through imports/APIs

How WASM Works:

Where do DOM, files, and networking come from?

Core WebAssembly does not define the DOM, filesystem calls, sockets, or a giant standard library. A Wasm module imports capabilities from whatever environment embeds it.

  • In a browser: JavaScript and web-platform bindings typically connect Wasm to DOM/Web APIs.

  • Outside a browser: the runtime can expose its own APIs, and WASI standardizes portable interfaces for many system capabilities.

This capability-based model is also part of the security story: a module cannot simply reach arbitrary host resources unless the embedding gives it a way to do so.

Real-World Use Cases:

  • Video and audio codecs

  • Game engines (e.g., Unity)

  • CAD applications

  • Scientific simulations

Benefits of WASM:

  1. Can perform very well for compute-heavy code, especially code ported from native ecosystems

  2. Lets substantial existing C/C++/Rust and other codebases target the web or portable runtimes

  3. Provides a compact, validated binary format with a strong sandbox model

  4. Can enable multi-language plugin/component systems outside the browser

Challenges:

  • Crossing the JavaScript ↔ Wasm boundary and copying/converting data can erase performance wins if you do it constantly

  • Wasm does not directly “own the DOM”; browser APIs come from the host, commonly through JavaScript/bindings

  • Debugging, profiling, source maps, language runtimes, and package/tooling quality vary by language/toolchain

  • Garbage-collected languages and rich host APIs may need runtime support or newer Wasm features/tooling

  • Small/simple JavaScript code can be faster to download, start, and maintain than pulling in a Wasm module plus glue code

Future Prospects:

  • Wasm is already beyond the browser: server, edge, plugin, embedded, and command-line runtimes exist today.

  • WASI: standards-track APIs are actively evolving for portable system access in non-web environments.

  • Component Model/tooling: newer tooling is improving composition and interoperability between modules written in different languages.

  • Wasm 3.0: the live standard now includes major additions such as 64-bit memories, garbage-collection support, and other capabilities that broaden what runtimes can target.

So should you rewrite your app in Wasm?

Probably not. Wasm shines when you have a measured compute bottleneck, an existing native library/codebase to reuse, a cross-language plugin/runtime use case, or a portability/sandboxing requirement.

If your bottleneck is network latency, DOM work, database queries, or shipping a giant payload, compiling the same logic to Wasm may accomplish approximately nothing—except adding a cool new file extension.

If you’re curious and want to learn it check out the docs

If you want to keep learning

  • JIT compilation explained — compare another way runtimes turn higher-level code into fast machine instructions.

  • How to choose a programming language — languages like Rust, C, and C++ can compile to WASM, but the best choice still depends on what you’re building.

  • Code profiling explained — use profiling to prove whether moving work to WASM actually improves the bottleneck you care about.

The Daily Newsletter for Intellectually Curious Readers

  • We scour 100+ sources daily

  • Read by CEOs, scientists, business owners and more

  • 3.5 million subscribers

Sign up today!

Microsoft releases powerful new Phi-3.5 models, beating Google, OpenAI and more (4 minute read)

Microsoft’s release of the Phi-3.5 series represents a significant step forward in the development of multilingual and multimodal AI.

Midjourney launched their website (11 minute read)

Midjourney opens its website to all users with limited free trials, allowing new users to create up to 25 images for free.

Shocker: French make surprise arrest of Telegram founder at Paris airport (2 minute read)

Lack of moderation on Telegram claimed to be reason for arrest.

Coolify

An open-source & self-hostable Heroku / Netlify / Vercel alternative.

Fixing a Bug in Google Chrome as a First-Time Contributor (17 minute read)

A rundown of my experience finding and fixing a bug in the Chromium/Google Chrome browser - specifically in the devtools.

Next.js + Supabase app in production: what would I do differently (13 minute read)

My learnings for building a Next.js and Supabase app and keeping it running in production

How To Write Maintainable Go Code? (13 minute read)

Gophers You have to write code that can be maintained when dealing with golang. Simplicity, readability, and clarity are the fundamental components of maintainable code.

Thank you to everyone who submitted last week 😃 

WaxAxiom, ddat828, Shraddha Patel, ravener, kwame-Owusu, AndrewMarin554, FragileBranch, sloprope, RelyingEarth8, OmarZaatari, DevonKirby, and so much more. Sorry if I didn’t include you, I got lazy…

Loves me, Loves me not…

"Loves me, loves me not" is a traditional game in which a person plucks off all the petals of a flower one by one, saying the phrase "Loves me" and "Loves me not" when determining whether the one that they love, loves them back.

Given a number of petals, return a string which repeats the phrases "Loves me" and "Loves me not" for every alternating petal, and return the last phrase in all caps. Remember to put a comma and space between phrases.

Examples

loves_me(3) ➞ "Loves me, Loves me not, LOVES ME"

loves_me(6) ➞ "Loves me, Loves me not, Loves me, Loves me not, Loves me, LOVES ME NOT"

loves_me(1) ➞ "LOVES ME"

Notes

  • Remember to return a string.

  • The first phrase is always "Loves me".

How To Submit Answers

Reply with

  • A link to your solution (github, twitter, personal blog, portfolio, replit, etc)

  • or if you’re on the web version leave a comment!

Video should be coming out this week or early next week. I think.

uhhh yeah that’s all I got. Nothing too crazy going on.

That’s all from me!

Have a great week, be safe, make good choices, and have fun coding.

See you all next week.

Keep Reading

Read all
arrow-right
envelope-simple

Join 50k+ developers and become a better programmer and stay up to date in just 5 minutes.

© 2026 Sloth Bytes.
beehiivPowered by beehiiv