WebAssembly / WebAssembly/component-model

Interaction with the memory64 proposal

Open
#22 11 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement pre-1.0
Dominant language
WebAssembly
Stars
1.4k
Forks
130
Avg merge
2d 1h
Merged PRs (30d)
15

Description

With the memory64 proposal for WebAssembly this will change the internal representation of types in the canonical ABI, notably where strings/lists now have 64-bit pointers and lengths instead of 32-bit pointers/lengths as they would today. The canonical ABI isn't fully fleshed out on the main branch yet but I wanted to open this issue ahead of time to start the discussion and log it at least.

In my mind the memory64 proposal provides a great opportunity to showcase how definitions of APIs at the component model layer works well regardless of the underlying wasm module. For example today WASI isn't specified for memory64 and might take a significant amount of work for both engines and toolchains alike to all catch up and define something for memory64. That being said if WASI were defined with the component model then defining the canonical ABI lowering from interface types to memory64 memories would be all that's necessary and bindings generators/engines would be updated appropriately to pick up support quickly.

In any case this is also somewhat of a pretty future-facing feature because of the relatively early stages of not only the memory64 proposal but also adoption in general. I figured it might be useful to keep in the back of our heads when defining the canonical abi though (e.g. the size of a type now needs to be parameterized on the size of memory in addition to the type itself)

Contributor guide

No contributing guide indexed for this repository

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 with the linked memory64 proposal and the canonical ABI work on the main branch; compare how pointer and length widths, plus type sizes, should vary with memory size. The issue names no files or tests, so done would require a settled design for memory64 canonical ABI lowering and documented implications for WASI and bindings.

Written by the indexing model from the issue text.

Assessment

Tech stack
wasm
Domain
backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.