<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/wasm-is-not-quite-a-stack-machine-yyk0doskb" -->

---
title: Wasm is not quite a stack machine | daily.dev
description: WebAssembly is widely described as a stack machine, but a closer look at its instruction set reveals it lacks the stack manipulation operations (dup, swap,...
canonical: https://daily.dev/posts/wasm-is-not-quite-a-stack-machine-yyk0doskb
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Wasm is not quite a stack machine | daily.dev
og:description: WebAssembly is widely described as a stack machine, but a closer look at its instruction set reveals it lacks the stack manipulation operations (dup, swap,...
og:url: https://daily.dev/posts/wasm-is-not-quite-a-stack-machine-yyk0doskb
og:image: https://api.daily.dev/og/posts/yYK0Doskb.png
og:image:alt: Wasm is not quite a stack machine
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Wasm is not quite a stack machine

**[Lobsters](https://daily.dev/sources/lobsters)** · 6 min read · 0 upvotes · 0 comments

## Summary

WebAssembly is widely described as a stack machine, but a closer look at its instruction set reveals it lacks the stack manipulation operations (dup, swap, over, rot) that define real stack machines like the JVM. Without these, Wasm cannot reuse values or perform common subexpression elimination without introducing local variables. This makes Wasm behave more like a register machine with compound expressions encoded in Reverse Polish notation — the stack is just an encoding detail, not a fundamental design. The multi-value extension further confirms this: before it, control flow blocks couldn't interact with the stack at all. The practical takeaway is that experience with traditional stack-based VMs doesn't transfer cleanly to Wasm.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://purplesyringa.moe/blog/wasm-is-not-quite-a-stack-machine>

## Similar posts on daily.dev

- [Thoughts on WebAssembly as a stack machine](https://daily.dev/posts/thoughts-on-webassembly-as-a-stack-machine-nidfun9ol) · Eli Bendersky · 2 upvotes · 0 comments
- [WebAssembly is everywhere. Here’s how it works](https://daily.dev/posts/webassembly-is-everywhere-here-s-how-it-works-d8uxjessm) · The New Stack · 2 upvotes · 0 comments
- [WebAssembly: The Web’s Fourth Language](https://daily.dev/posts/webassembly-the-web-s-fourth-language-twkny7sfg) · Medium · 3 upvotes · 0 comments
- [WebAssembly: an introduction](https://daily.dev/posts/webassembly-an-introduction-1iycvposp) · Flavio Copes · 3 upvotes · 0 comments
- [The 7 Walls JavaScript Hits — and How WebAssembly Gets Past Them](https://daily.dev/posts/the-7-walls-javascript-hits-and-how-webassembly-gets-past-them-isxmm7isd) · DEV · 2 upvotes · 0 comments

---

Tags: [#webassembly](https://daily.dev/tags/webassembly), [#compiler](https://daily.dev/tags/compiler)

[View this post on daily.dev](https://daily.dev/posts/wasm-is-not-quite-a-stack-machine-yyk0doskb)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Wasm is not quite a stack machine","url":"https://daily.dev/posts/wasm-is-not-quite-a-stack-machine-yyk0doskb","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/wasm-is-not-quite-a-stack-machine-yyk0doskb"},"datePublished":"2026-04-27T13:01:05.672Z","dateModified":"2026-04-27T13:01:32.617Z","description":"WebAssembly is widely described as a stack machine, but a closer look at its instruction set reveals it lacks the stack manipulation operations (dup, swap,...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/739c6eaf28d9f3efba24afa1ddf3a0be?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/739c6eaf28d9f3efba24afa1ddf3a0be?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Lobsters","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Lobsters","logo":"https://media.daily.dev/image/upload/s--tl8v_Fku--/f_auto,t_logo/v1698841318/logos/lobste.jpg","url":"https://daily.dev/sources/lobsters"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/wasm-is-not-quite-a-stack-machine-yyk0doskb","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"webassembly,compiler","timeRequired":"PT6M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Lobsters","item":"https://daily.dev/sources/lobsters"},{"@type":"ListItem","position":3,"name":"Wasm is not quite a stack machine"}]}
```

