DLR-FT / wasm-interpreter

A minimal in-place WebAssembly interpreter, written in Rust, almost without use of external dependencies
https://dlr-ft.github.io/wasm-interpreter/main/
Apache License 2.0
3 stars 2 forks source link

Documentation: How unreachable changed our validation design #82

Open nerodesu017 opened 1 week ago

florianhartung commented 1 week ago

@nerodesu017 I think the current documentation in validation_stack.rs is sufficient. But maybe that's because I was the one who implemented it😅 Do you think more documenting needs to be done?

nerodesu017 commented 6 days ago

After re-reading the validation algorithm found on the WASM Spec, the comments are more than enough for me, to say the least. I assume we can leave it like this. I did have a bit of trouble understanding why we used a unified stack and I think I figured it out, correct me if I'm wrong, but I reckon it's because it's simpler and easier, all whilst mimicking the execution model.

florianhartung commented 6 days ago

Yes, you're correct. We use a unified stack because of the similarity to the execution model. Also separating the stack would introduce more bookkeeping. This way we don't have to keep the data of two stacks consistent, because this consistency is guaranteed by the data structure.

(Maybe @wucke13 has something to add, but I'm pretty sure that's it)