HackerTrans
TopNewTrendsCommentsPastAskShowJobs

pasxizeis

no profile record

Submissions

Dabbling in Erlang, part 2: A minimal introduction (2013)

agis.io
40 points·by pasxizeis·2 ay önce·8 comments

Show HN: Wasm decoder with focus on helpful errors/diagnostics

github.com
2 points·by pasxizeis·7 ay önce·0 comments

comments

pasxizeis
·3 ay önce·discuss
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.
pasxizeis
·3 ay önce·discuss
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
pasxizeis
·4 ay önce·discuss
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
pasxizeis
·5 ay önce·discuss
Slowly but steadily implementing support for version 3 of the Wasm specification in my wasm parser (written from scratch): https://github.com/agis/wadec
pasxizeis
·6 ay önce·discuss
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
pasxizeis
·6 ay önce·discuss
I started learning Rust more actively and then WebAssembly, via building https://github.com/agis/wadec.

I plan to continue doing that in 2026.
pasxizeis
·6 ay önce·discuss
Happy new year from Greece!
pasxizeis
·6 ay önce·discuss
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
pasxizeis
·7 ay önce·discuss
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.
pasxizeis
·7 ay önce·discuss
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.
pasxizeis
·8 ay önce·discuss
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.
pasxizeis
·8 ay önce·discuss
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.)

My aim is probably not for it to become a highly-performant decoder for use in production environments, but rather one that can be used for educational purposes and/or debugging issues with existing 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.
pasxizeis
·8 ay önce·discuss
As a Rust newbie and seasoned Go dev, I'm pretty interested to knownwhere would people experienced in both OCaml and Haskell, would put it in the spectrum.
pasxizeis
·8 ay önce·discuss
Amazing work!

Where would you suggest someone to start if they wanted to get familiar with the codebase?

Also, what are the next steps for the project?
pasxizeis
·9 ay önce·discuss
As a means to get into WebAssembly, I started writing a WebAssembly binary decoder (i.e. a parser for `.wasm` files) from scratch.

Recently I started executing the upstream spec tests against it, as a means to increase spec conformance. It's non-streaming, which is a non-starter for many use cases, but I'm hoping to provide a streaming API later down the road. Also, the errors interface are still very much WIP.

All that said, it's getting close to a fully-conformant one and it's been a really fun project.

https://github.com/agis/wadec

P.S. I'm new to the language so any feedback is more than welcome.
pasxizeis
·9 ay önce·discuss
Started writing a WebAssembly binary decoder, as a means to learn both more about wasm and Rust: https://github.com/agis/wadec.