WebAssembly / WebAssembly/component-model

Import name projections don't support exports by interface name

Open
#301 13 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
WebAssembly
Stars
1.4k
Forks
130
Avg merge
2d 1h
Merged PRs (30d)
15

Description

Currently the projection rule for import names looks like:

projection    ::= '/' <label>
label         ::= <word>
                | <label> '-' <word>

This prevents projections for exports using the interfacename format, as these cannot be expressed simply as a label.

Say component foo:bar exports an instance with name bar:baz/qux (i.e. in interfacename format) and we wanted to import this instance from another component, but reference a possible implementation using an unlocked-dep import rather an import of an interface name. We're unable to express this because bar:baz/qux cannot be represented as a projection.

One possible solution:

Extend the projection rule as follows:

projection          ::= '/' <projection-segment>
projection-segment  ::= <label> | '<' <interfacename> '>' 

Or using some other delimiter to denote that the segment is an interface name and not a label.

Contributor guide

No contributing guide indexed for this repository

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 import-and-export definitions section of design/mvp/Explainer.md and review the existing projection grammar. Check the issue discussion before proposing syntax for interface-name exports; done means the grammar and accompanying explanation unambiguously support these projections.

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
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.