# Wax lets you write WebAssembly in a Rust-like syntax that compiles to the same bytes

Original title: Wax: A User-Friendly Syntax for WebAssembly

> Hacker News story 50761885 · language: en · submitted 2026-12-04
> Web version: https://zeli.app/story/50761885
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 168 · by [theanonymousone](<https://news.ycombinator.com/user?id=theanonymousone>) · 💬 43
[original](<https://tarides.com/blog/2026-11-26-wax/>) · [HN discussion](<https://news.ycombinator.com/item?id=50761885>)

## Summary

Wax is a Rust-like syntax for WebAssembly designed for people who hand-write Wasm. It compiles to exactly the same instructions as the text format, and its OCaml toolchain converts between Wax, WAT, and binary in every direction. The wasm_of_ocaml runtime's roughly 27,000 lines of hand-written WAT shrink to about 320 lines of Wax for one file, and a decompiler round-trips modules back to an identical instruction stream.

## Key quote

> The text format was designed so that a tool could print a binary and a human could check what the tool did. It was never meant for someone to sit down and write twenty-seven thousand lines of it.

## HN discussion (43 comments)

### [sheept](<https://news.ycombinator.com/item?id=50762628>)

> Not super related, but I love that the text representation of wasm is named WAT, it feels like a callback to the infamous Javascript talk, Wat[0]
>
> [0]: https://www.destroyallsoftware.com/talks/wat

### [pcwalton](<https://news.ycombinator.com/item?id=50763690>)

> Reminds me a bit of GCC's GIMPLE. For example: https://gcc.gnu.org/onlinedocs/gcc-4.2.3/gccint/GIMPLE-Examp...
>
> Unlike LLVM IR, which has a wildly different syntax from any other language, GCC's SSA IR was designed to look like a subset of C. There are some obvious benefits of doing it that way. Wasm can be even closer to a high level language because it has high level control flow...

### [koolala](<https://news.ycombinator.com/item?id=50766093>)

> Curious to see what its SIMD syntax looks like. Was this article / language LLM written? It's great Wax compiles easy in the browser.

### [gavinray](<https://news.ycombinator.com/item?id=50763096>)

> This is essentially just Rust with the compile target set to WASM, though?
>
> WASM Text (WAT) is not really meant to be human-authored, it's an IR representation, like LLVM IR.
>
> The one genuine use I could see out of this is the ability to go backwards, from WAT -> High-level language
>
> \> "Compilers usually run one way. The most interesting engineering in Wax is in the reverse arrow."

### [julesrms](<https://news.ycombinator.com/item?id=50762858>)

> Very nice.
>
> Having done a bit of staring-at-WASM while building a compiler, I never stopped being annoyed by the question of who came up with that terrible parentheses syntax. I could never see how it made any sense for any use-case.
>
> Obviously the very top-level parser for the parenthesis stuff is simpler than a parser for a more complex syntax like Wax's. But that is a tiny part of the parser's job, and the savings are marginal. Just because you start by parsing the text into a simple node tree, you still have to check that tree against the implicit syntax that you're expecting it to conform to, and a lot of that checking could have been avoided by pushing it into the actual syntax of a nicer language. They already have a binary format, so the whole point of this text format is to be human-readable, which it absolutely isn't. So the compromise it makes to make the parser very slightly simpler just seems mad to me. Anyway, end of rant..

---

## Cite

- Page: https://zeli.app/story/50761885
- Date: 2026-12-04
- Source: tarides.com (https://tarides.com/blog/2026-11-26-wax/)
- Hacker News: https://news.ycombinator.com/item?id=50761885

## Other languages

- zh: https://zeli.app/zh/story/50761885 · markdown: https://zeli.app/zh/story/50761885.md
- ja: https://zeli.app/ja/story/50761885 · markdown: https://zeli.app/ja/story/50761885.md
- ko: https://zeli.app/ko/story/50761885 · markdown: https://zeli.app/ko/story/50761885.md
- de: https://zeli.app/de/story/50761885 · markdown: https://zeli.app/de/story/50761885.md
- es: https://zeli.app/es/story/50761885 · markdown: https://zeli.app/es/story/50761885.md
- ru: https://zeli.app/ru/story/50761885 · markdown: https://zeli.app/ru/story/50761885.md
