-
Notifications
You must be signed in to change notification settings - Fork 695
Should WebAssembly files support metadata/comments? #208
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
Comments
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? |
Using ELF as discussed in #74 may influence this suggestion. |
@ncbray agreed, it sounds useful, but not for v1. |
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. |
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. |
@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. |
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. |
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. |
WebAssembly will ignore unknown sections. I'll create a PR to update the binary format with that info. |
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.
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:
Will WebAssembly support some kind of comment or metadata format, for similar file identification purposes?
The text was updated successfully, but these errors were encountered: