Skip to content

Should WebAssembly files support metadata/comments? #208

Closed

Description

@dhodder

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?

Activity

  1. ncbray commented on Jun 19, 2015

    @ncbray

    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?

  2. jfbastien commented on Jun 19, 2015

    @jfbastien
    Member

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

  3. johnku1 commented on Jun 20, 2015

    @johnku1

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

  4. added this to the MVP milestone on Jul 29, 2015
  5. sunfishcode commented on Jul 29, 2015

    @sunfishcode
    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.

  6. kenchris commented on Jul 29, 2015

    @kenchris

    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.

  7. qwertie commented on Jul 29, 2015

    @qwertie

    @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.

  8. kenchris commented on Jul 29, 2015

    @kenchris

    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.

  9. sunfishcode commented on Jul 29, 2015

    @sunfishcode
    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.

  10. jfbastien commented on Feb 24, 2016

    @jfbastien
    Member

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

  11. added a commit that references this issue on Feb 25, 2016
    a7d67f1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions