WebAssembly / WebAssembly/shared-everything-threads

Change "share" syntax in func type

Open
#106 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
WebAssembly
Stars
97
Forks
6
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading this proposal together with the referenced discussion in issue #81 and considering the wasm-language-tools parsing impact described here. Done means reaching agreement on the syntax and documenting the resulting type grammar and effects on the syntax tree and language-server analyses.

Written by the indexing model from the issue text.

Assessment

Tech stack
wasm
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.