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

Interleaved "header" sections and the text format #25

@alexcrichton

Description

@alexcrichton

I figured it was good to make a dedicated issue for this given the discussion happening on a few other places at this point as well. In the module linking proposal the initial sections (type, module, instance, and alias), can all appear interleaved. This issue is intended to ask the question "how do we represent this in the text format?" Some current known things are:

(import "" "" (func (type $t)))
(type $t (func))

so should this keep working?

  • There should probably be a mechanism for @custom and repeated sections annotations#11 where custom sections may need to be explicitly placed after a particular header section.

  • Ideally the text format is "round-trip-able" where given any sequence of sections in a binary module when printed there's a way you can convert that text back to binary and produce the same module.

This seemed independent enough from other issues that it might be good to have a singular place to discuss here! One possible option I'd propose is new grouping constructs like (aliases ...), (types ...), (imports ...), etc. Internally they would only allow the corresponding field to be declared and they would be serialize as-is with the group. Top-level singular items would then be sorted in a predefined order (e.g. types, imports, modules, instances, aliases) and would just simply be an error in validation if they referenced one another. This is not a great solution, though, and I hope a better idea is found.

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