Skip to content

Updating import/export tables in the binary format #522

@titzer

Description

@titzer

Pending #520, the binary format should be updated to match the design.

The difference between the current format and AstSemantics.md is as follows:

In the binary format, there is a single function declaration table with a single index space for functions, including imported functions. An entry in this table can be either: named or unnamed, either: an imported function or a defined function, either: exported or not exported.

Consequences of this:

  • call_function can index both imported and defined functions.
  • imported functions can appear in the indirect function table.
  • imported functions can be immediately re-exported

In the AstSemantics.md, there are imported functions and defined functions. The two index spaces are separate and there are separate call_function and call_import operators.

Consequences of this:

  • call_function and call_import index separate tables.
  • imports cannot appear in the indirect function table.
  • imported functions cannot be immediately re-exported

So this issue proposes updating the binary format to match the AstSemantics, introducing an import table and an export table. If there aren't any strong objections I will start working on implementing it and wait to describe it when we make more progress on #520.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions