Skip to content

Question about instances #621

Description

@zherczeg

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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