WebAssembly / WebAssembly/shared-everything-threads

Text format for shorthand `shared` functions

Open
#81 6 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

The current text format only allows specifying a shared function with an explicit type index:

(type $shared (shared (func)))
(func (type $shared))

I had thought (and so have others) that it might be nice to have a short-hand form for writing shared functions when printing WAT. There are some advantages to this: easier to read WAT, easier to write WAT manually, consistency with unshared functions, etc. But, for now, we have left this out because it's unclear how to best express this:

  • (shared (func ...))?
  • (func (shared (param) (result)) ...)?

I'm opening this issue to track this for discussion and for future users who are interested in why things are the way they are.

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 with the current WAT examples in the issue and the linked pull request review. Compare the two proposed shorthand forms for readability, consistency with unshared functions, and compatibility with existing syntax. Done means the discussion reaches an agreed syntax and documents why it was chosen.

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
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.