WebAssembly / annotations

Proposal for Custom Annotation Syntax in the Text Format
https://WebAssembly.github.io/annotations/
Other
19 stars 10 forks source link

Name annotations vs arbitrary identifiers #1

Closed AndrewScheidecker closed 2 months ago

AndrewScheidecker commented 6 years ago

While I think this kind of metadata could be useful for stuff like the host bindings, I don't think it's a good solution to the arbitrary names issue. Consider:

(module
  (func $lambda (@name "λ") ...)
  ... (call $lambda) ...
)

What should this "disassemble" to? You would need to add a way to store both names for $lambda in the name section, and for producers to produce something useful for both names. Otherwise you're going to end up with something like this:

(module
  (func $0 (@name "λ") ...)
  ... (call $0) ...
)

I think it's simpler to extend the identifier syntax to support arbitrary strings (as discussed in the original issue):

(module
  (func $"λ" ...)
  ... (call $"λ") ...
)
tlively commented 3 months ago

The discussion about this idea ended up being held on #21, so this can probably be closed.

rossberg commented 2 months ago

Closing as duplicate of #21.