Skip to content

Change "share" syntax in func type #106

@g-plane

Description

@g-plane

How about considering the share keyword coming before (func ...) without parens? Like this:

(type $shared shared (func))

In this syntax, we don't need to change how to parse (func) and the syntax tree.

For instance, currently in wasm-language-tools, the syntax kind of (func) is FUNC_TYPE and it's one of the children of the type definition syntax. But for (type (shared (func))), the (func) part won't be the direct child of type definition any more; instead, it will become an indirect descendant of type definition, which causes a huge breaking change to analysises in language server.

Another advantage of the syntax I proposed is, the share keyword will look like a "modifier" of comptype, instead of something like additional attributes of comptype. Because, comptype itself shouldn't concern whether it's shared or not, I think.

Also, in memtype syntax (from "Threads" proposal), it's also just a single word without parens and something else.

Originally posted by @g-plane in #81

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions