descriptor / described type ordering constraints

Open
#125 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
15/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
wasm
Domain
compilers

Research direction

The payload names no files or tests. Start with the linked discussion in pull request 124 and the current rule that a described type must precede its descriptor. This is an open design question about whether to keep that ordering and whether descriptor types should come first, so a newcomer's first step is to read the thread and not to write code. Done means the maintainers agree on the ordering rule and the validation consequences are written down.

Written by the indexing model from the issue text.

Description

Currently we require a described type to appear before its descriptor type. The ordering constraint statically rules out descriptor cycles. The rationale for this ordering is that we expect described types to be referenced more frequently in the module, so it is better to give them smaller indices for smaller LEB index encoding. Also, it Just Makes Sense that you would want to see the "more concrete" type first.

However, @rossberg raised the questions of whether we need the ordering constraint at all, and if so, whether it would be nicer to have descriptor types first, matching the necessary order of construction.

There should be no runtime problem with allowing descriptor cycles; the involved types will just be uninhabitable. There might be some small extra complication in streaming type decoding and validation, since the validator would no longer be able to assume that described and descriptor types will or will not have been decoded.

Dominant language
WebAssembly
Stars
13
Forks
3
Avg merge
3d 3h
Merged PRs (30d)
17

Getting set up

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.

More from WebAssembly/custom-descriptors

All issues in WebAssembly/custom-descriptors

Similar issues

More Compilers issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.