WebAssembly / WebAssembly/custom-descriptors

Non-nullability in the signature of `configureAll`

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

Nobody has claimed this yet.

Dominant language
WebAssembly
Stars
12
Forks
3
Avg merge
3d 2h
Merged PRs (30d)
1

Description

Currently the parameters to configureAll are all nullable references, following the convention of using nullable references in the inputs to core Wasm instructions. However, passing a null value for the prototypes, methods, or data array references is currently an error. We could make these parameters non-nullable if there were any benefit. (In contrast, passing a null value for the constructors object is fine if there are no configured constructors.)

Furthermore, both the prototypes array and methods array contain nullable references. It is an error for a method in the methods array to be null, but we currently allow null values in the prototypes array. Allowing null prototypes is maximally flexible but questionably useful, so we could make the elements of either or both of these arrays non-nullable as well. This is more likely to have a performance impact because this would let us elide many more null checks.

Actually using configureAll on the intended hot path (using array.new_elem) with non-nullable array elements would be blocked on Binaryen supporting non-nullable segment types, which we should probably do anyway (https://github.com/WebAssembly/binaryen/issues/5628).

Contributor guide

Open the contributing guide

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.

Research direction

Start by reviewing the configureAll signature and its handling of prototypes, methods, data, and constructors. Check Binaryen issue #5628 for the non-nullable segment dependency; this issue needs a decided nullability policy before implementation, with compatibility and the intended hot path validated afterward.

Written by the indexing model from the issue text.

Assessment

Tech stack
wasm
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.