A (from scratch) Wasm binary decoder - looking for feedback

⚓ Rust    📅 2025-12-21    👤 surdeus    👁️ 1      

surdeus

Hello! As my second Rust project, I decided to write a WebAssembly Module decoder, for the binary format (i.e. a parser for .wasm files).

I'm particularly looking for advice regarding the error types design but also the code organization. I put a lot of effort into making sure that you can tell what the AST of the module looks like, given the error you got (see "Usage" in README), but I'm not sure whether I overdid it or whether it's the idiomatic way to do it.

One thing currently bothering me, is that pretty much everything is tossed in src/lib.rs, which makes it a bit hard to wrap my head around, because a lot of these things are logically separated. So I'm considering splitting things into various sub-modules like sections::code, sections::exports, sections::imports etc.

Any feedback is more than appreciated!

1 post - 1 participant

Read full topic

🏷️ Rust_feed