Declarative WASM GC Types
Web page · https://blog.veritates.love/decl-wasm-types
First seen by Oriel on .
AI summary
The article develops a Haskell representation for generating WebAssembly GC types declaratively, focusing on how recursive subtype groups are modeled and assigned type-table indices.
- The proposed type model separates stack types (`WTyp`), heap type designations (`HTyp`), composite types (`CTyp`), recursive groups (`RTyp`), and subtypes (`SubTyp`).
- Composite types describe structs, arrays, and functions, while references can nest these types in Haskell values before WebAssembly indices are allocated.
- A recursive type group is represented as a map of locally named subtypes; the selected subtype is paired with its group, and ordering requires a topological sort.
- WebAssembly assigns indices to subtypes within recursive groups, not directly to composite types; group members can reference one another, but subtype relations must point backward.
- The representation omits metadata such as struct field names and treats packed `i8` and `i16` through the same `WTyp` layer for convenience.
#webassembly #webassembly gc #haskell #type systems
Generated by gpt-5.6-sol. Check the original for details.
Metric trends
Last 30 days · Up to 120 recorded samples per source and metric, with reposts kept separate · First and latest retained
Points
Score reported by the source.
- Lobsters: 2, latest observation ; +1 over observed period since
Comments
Comment count reported by the source.
- Lobsters: 0, latest observation ; 0 over observed period since
Aliases
| Source | External ID | URL |
|---|---|---|
| Lobsters | 72bkyt | https://blog.veritates.love/decl-wasm-types Read discussion |