Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should WebAssembly files support metadata/comments? #208

Closed
dhodder opened this issue Jun 19, 2015 · 9 comments
Closed

Should WebAssembly files support metadata/comments? #208

dhodder opened this issue Jun 19, 2015 · 9 comments
Milestone

Comments

@dhodder
Copy link

dhodder commented Jun 19, 2015

Minified JavaScript files, such Angular or jQuery, typically still include file information inside an opening comment block. This might include the name and version number of the software, copyright and licensing details, and maybe a URL leading to the original source code form. For example:

/*
 ExampleJS v1.3.16
 (c) 2010-2014 Example Foundation. http://example.org
 License: MIT
*/

Will WebAssembly support some kind of comment or metadata format, for similar file identification purposes?

@ncbray
Copy link

ncbray commented Jun 19, 2015

The binary encoding will have multiple "sections", and I believe the current plan is that sections with an unknown type are ignored. So adding a metadata section, either now or in the future, would be a backwards compatible change. It seems like a good idea to keep in mind, but not critical for v1?

@jfbastien
Copy link
Member

Using ELF as discussed in #74 may influence this suggestion.

@johnku1
Copy link

johnku1 commented Jun 20, 2015

@ncbray agreed, it sounds useful, but not for v1.

@sunfishcode sunfishcode added this to the MVP milestone Jul 29, 2015
@sunfishcode
Copy link
Member

We're planning to have sections, ELF or not, and unknown sections will be ignored, so I'd guess people will make their own comment sections if we don't define one. And I imagine it'll be easy to define one, so let's do this for the MVP.

@kenchris
Copy link

How does this relate to annotations which are being planned for ES2016? I assume that annotation will be used for many of these things and it would be good that this would work for that.

@qwertie
Copy link

qwertie commented Jul 29, 2015

@kenchris Annotations? Googling that finds "decorators" which seem not to be metadata, but just functions that are invoked to ... enable some forms of ES metaprogramming.

@kenchris
Copy link

Right, I meant decorators. They can be used for metadata and I was thinking about introspection. If they are just defined as functions there should probably be no problem.

@sunfishcode
Copy link
Member

I think this isn't related. All I'd expect we might do here is define a "comment" section that isn't semantically visible.

#265 has some ideas that are related though.

@jfbastien
Copy link
Member

WebAssembly will ignore unknown sections. I'll create a PR to update the binary format with that info.

jfbastien added a commit that referenced this issue Feb 25, 2016
Fixes #208.

A later PR will make sure all sections start with the same format (so all sections use bytes, instead of count, making it easy to know the byte count of unknown sections). We'll also use strings instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants