Skip to content
This repository was archived by the owner on May 6, 2022. It is now read-only.
This repository was archived by the owner on May 6, 2022. It is now read-only.

Implement alias syntactic sugar #4

@Pyrolistical

Description

@Pyrolistical

Problem

Note the kind first alias sugar will be implemented by #2.

Alias syntactic sugar forms are not supported. https://github.com/WebAssembly/module-linking/blob/main/design/proposals/module-linking/Explainer.md#alias-definitions

Instance-export alias sugar

Sugar

(export "x" (func $j "g" "h"))

Desugared

(alias $j "g" (instance $g_alias))
(alias $g_alias "h" (func $h_alias))
(export "x" (func $h_alias))

Outer alias lexical scoping sugar

Sugar

(adapter module
  (module $N ...)
  (adapter module
    (instance (instantiate $N))
  )
)

Desugared

(adapter module $M
  (module $N ...)
  (adapter module
    (alias $M $N (module $N))
    (instance (instantiate $N))
  )
)

Without this feature, the purpose of this project would be violated. Users trying to learn how Module linking works would face difficulties.

Ideals

  1. Config should not require any changes
  2. Runtime should not require any changes

Acceptance criteria

  1. Tests that prove type definitions are working
  2. New demo example that uses type definitions
  3. This feature interactions correctly with Support symbolic index references #1
  4. This feature interactions correctly with Support import/alias kind first forms #2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions