bytecodealliance / bytecodealliance/wasm-tools

components: Implement automatic deduplicating of text format type sugar

Open
#598 3 comments 0 reactions 0 assignees View on GitHub
component-model wast
Dominant language
Rust
Stars
1.8k
Forks
351
Avg merge
16h 57m
Merged PRs (30d)
38

Description

Currently a module textually represented like so:

```wasm
(component
(import "" (func))
(import "" (func))
)
```

dumps as:

```
0x0 | 00 61 73 6d | version 65546 (Component)
| 0a 00 01 00
0x8 | 01 05 | type section
0xa | 02 | 2 count
0xb | 7f | [type 0] Interface(Primitive(Unit))
0xc | 4c 00 00 | [type 1] Function(ComponentFuncType { params: [], result: Type(0) })
0xf | 02 03 | import section
0x11 | 01 | 1 count
0x12 | 00 01 | [func 0] ComponentImport { name: "", ty: 1 }
0x14 | 01 05 | type section
0x16 | 02 | 2 count
0x17 | 7f | [type 2] Interface(Primitive(Unit))
0x18 | 4c 00 02 | [type 3] Function(ComponentFuncType { params: [], result: Type(2) })
0x1b | 02 03 | import section
0x1d | 01 | 1 count
0x1e | 00 03 | [func 1] ComponentImport { name: "", ty: 3 }
```

Here two function types are added (type 1 and type 3 above) but instead only one should be added. There are annotated FIXME annotations for this in the codebase where hashing support needs to be added.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.