Get the latest tech news

A WebAssembly compiler that fits in a tweet


Starting with a 192-byte one-liner that implements a Reverse Polish Notation arithmetic compiler, we'll work backward to transform it into readable JavaScript by removing one code golf trick at a time

One of the initial explorations that started this book was how small and simple a compile-to-WebAssembly language implemented in JavaScript could be. At a high level, what we’re doing is ‘parsing’ the expression in a very simple way, turning it into the appropriate Wasm bytecode, and then hand-crafting the bytes for a single-function module. You’ll learn the ins and outs of WebAssembly by writing a real compiler for a simple programming language.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of Tweet

Tweet

Photo of WebAssembly

WebAssembly

Photo of WebAssembly compiler

WebAssembly compiler

Related news:

News photo

MultiVersus pulls tweet after Charlie the Unicorn creator says it used his work "without permission"

News photo

WASM-4: Build retro games using WebAssembly for a fantasy console

News photo

WebVM 2.0: A complete Linux Desktop Environment in the browser via WebAssembly