WebAssembly / design

WebAssembly Design Documents
http://webassembly.org
Apache License 2.0
11.41k stars 694 forks source link

External name for memory export? #607

Closed ghost closed 8 years ago

ghost commented 8 years ago

The current binary encoding has a byte flag for memory export, and v8 seems to interpret this an export named "memory". The spec seems to support other names, and even multiple exports of the memory with different names. Looks like an issue to be resolved.

Teemperor commented 8 years ago

The original pull request 243 also had a discussion about that.

ghost commented 8 years ago

@Teemperor The link might not be correct? Could you summarize the reason why the spec and encoding seem to differ here?

Teemperor commented 8 years ago

@JSStats Fixed the link, thx!

ghost commented 8 years ago

@Teemperor Thank you but I still don't see an answer there? In fact that PR includes the follow test which not only names the memory something other than "memory" but has multiple names for it. The binary encoding has only a single bit to flag the memory as being exported and can not represent these names?

(module (memory 0 0) (export "a" memory) (export "b" memory))
Teemperor commented 8 years ago

Yeah, I just wanted reference the related discussion about "why multiple memory exports" :)

sunfishcode commented 8 years ago

As of #682, memory exports do have an external name. However, BinaryFormat.md is not yet updated to reflect this.