Hacker Newsnew | past | comments | ask | show | jobs | submit | pasxizeis's commentslogin

As a means to learn about both WebAssembly and Rust, I started writing a WebAssembly binary decoder (i.e. a parser for `.wasm` files) from scratch.

Recently it hit v3 spec conformance. (I'm executing the upstream spec test suite.)

I don't plan to make it a highly-performant decoder for use in production environments, but rather one that can be used for educational purposes, easy to read and/or debugging issues with modules. That's why I decided not to offer a streaming API, and why I'll be focusing on things like good errors, good code docs etc.

https://github.com/agis/wadec

P.S. I'm new to the language so any feedback is more than welcome.


I followed the same testing approach when writing a Wasm binary parser (technically, a decoder)[0].

It was pretty helpful having the official spec suite available and a major boost of confidence that your parser is compliant.

Nevertheless, it was my own tests that found a regression in the latest published version of the spec[1], which shows how important it is to have a variety of implementations.

[0] https://github.com/agis/wadec

[1] https://github.com/WebAssembly/spec/issues/2066


Tangential: I decided to write a Wasm parser (more precisely, a decoder the the Wasm binary format) from scratch, as a means to learn both Wasm and Rust[0].

It was the first time I was writing this sort of thing, but I found the spec very clear and well-written.

Fun fact: I was surprised when the test from a toy parser surfaced a real regression in version 3 of the spec[1], released roughly 4 months before.

[0] https://github.com/agis/wadec

[1] https://github.com/WebAssembly/spec/issues/2066


Slowly but steadily implementing support for version 3 of the Wasm specification in my wasm parser (written from scratch): https://github.com/agis/wadec


Writing a WebAssembly module parser from scratch, focusing on good diagnostics/errors and DX.

Currently it's fully-conformant to v2.0 of the spec, while I'm working towards implementing the recently released 3.0 version.

https://github.com/agis/wadec


I started learning Rust more actively and then WebAssembly, via building https://github.com/agis/wadec.

I plan to continue doing that in 2026.


Happy new year from Greece!


Φίλε έχουμε ακόμα κάνα οχτάωρο... Happy new year anyway!


I plan to continue building the hobby project I started (a Wasm module parser[1]) by implementing version 3 of the WebAssembly specification and eventually implementing the Validation phase.

[1] https://github.com/agis/wadec


As a means to learn about both WebAssembly and Rust, I started writing a WebAssembly binary decoder (i.e. a parser for `.wasm` files) from scratch.

Recently it hit v2.0 spec conformance. 3.0 is next on the roadmap. (I'm executing it against the upstream spec test suite.)

I don't plan to make it a highly-performant decoder for use in production environments, but rather one that can be used for educational purposes, easy to read and/or debugging issues with modules. That's why I decided not to offer a streaming API, and why I'll be focusing on things like good errors, good code docs etc.

https://github.com/agis/wadec

P.S. I'm new to the language so any feedback is more than welcome.


This is cool.

I started to look at the wasm stuff, but all the documentation I found was so high-level as to be meaningless.

What do you recommend for someone who would want to be able to create or read .wasm files?


I'd say jump straight to the specification (maybe v2, which is simpler).

But I occasionally saw one or two articles around where they explain how the binary format works, which could be a good introduction before jumping to the spec.


Thanks!


Really happy to see Pat keeping it up! His first Ruby under a Microscope book but also his blog posts are amazing and a major source of inspiration for me. I did meet him personally in a Euruko conference. Such a great person.


What a lovely comment - thank you!


whoa, the man himself! I second the praise, an all around excellent writer!


Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: