WebAssembly / spec

WebAssembly specification, reference interpreter, and test suite.
https://webassembly.github.io/spec/
Other
3.16k stars 452 forks source link

Don't emit `module definition` or `module instance` unless present in input when generating `.bin.wast` #1811

Open titzer opened 1 month ago

titzer commented 1 month ago

The PR #1796 changed the reference interpreter to generate these new commands by default in arrange.ml. Unfortunately this breaks downstream clients that consume .bin.wast.

Would it be possible to only emit module definition and module instance if they were in the original source?

rossberg commented 1 month ago

I'll look into it. It might be non-trivial, since the old form is desugared in the parser already.

Edit: Won't these clients have to be adapted anyway? Otherwise they won't be able to run all tests either way.

titzer commented 1 month ago

Ok, thanks for taking a look. If it's nontrivial work, don't waste too much time on it.

Won't these clients have to be adapted anyway? Otherwise they won't be able to run all tests either way.

Yes, eventually, when tests start using the new feature. I just hit this because I was writing tests for the stack-switching proposal which recently had this change integrated, and thus Wizard couldn't run my new tests.