WebAssembly / WebAssembly/component-model

Explicit field offsets in records?

Open
#194 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

In some situations, we might want to describe record types from existing binary formats or low-level software layers that already have fixed layouts that cannot be changed. Sometimes such records have alignment or unused space between fields. A natural way to express this is to have (byte) offsets on fields, rather than relying on a particular packing behavior.

For example, I've found this particular useful for describing file formats and kernel interfaces in a related project.

Is this something that could be added to the WIT record definition, e.g. as an optional field offset?

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 by reviewing the WIT record definition and the fixed-layout binary format and kernel interface use cases described in the issue. Determine the scope and semantics of optional field offsets, with the WIT specification updated only after the design is agreed.

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
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.