WebAssembly / WebAssembly/component-model

Question about instances

Open
#621 21 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

I am trying to implement a component text/binary parser, and a lot of things are confusing for me. These are validated examples.

(component $C
  (type s32)
  (instance (export "inline" (type 0)))
)

What kind of component does the instance create? $C?

(component
  (type (component
    (import "x" (instance $I (export "f" (func))))
    (alias export $I "f" (func))
  ))
)

For me a type should contain only types or some descriptors, but it seems any mutable objects can be added a to (non-mutable?) type.

The most confusing part is how instances are connected? E.g. the (func (param "X" (list (list s32)))) is the import and export of two components, and the import side wants to call this function. What should happen? How this is represented in core module side? How the data is transferred?

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 component text/binary parser and the examples involving component, type, instance, import, export, alias, and core modules. Trace how instances connect across component boundaries and how values such as nested lists are represented and transferred; done means the issue's conceptual questions are answered clearly in the relevant specification documentation.

Written by the indexing model from the issue text.

Assessment

Tech stack
wasm
Domain
compilers
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.