WebAssembly / WebAssembly/component-model
🪙 Value text encoding ambiguities / quirks
Nobody has claimed this yet.
- Dominant language
- WebAssembly
- Stars
- 1.4k
- Forks
- 130
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 15
Description
In looking at WAVE mapping to value defs (ref https://github.com/WebAssembly/component-model/pull/639#issuecomment-4292311870) I found some quirks in the val rules:
char- Allows unescaped single quote
(value char '''), which is unambiguous in context but seems awkward to parse and confusing to read (especially if you're used to Python!). - Rejects unescaped double-quote (
'"'), which is slightly annoying to me, personally. 🙂
- Allows unescaped single quote
- floats
f32is encoded ascore:f64which leaves rounding and overflow ambiguous, e.g.core:f64accepts1e99which will overflow anf32.f64canonrejectsnan:0xbut not-nan
- Handles in variants:
- Currently this would seem to be valid:
(value (option (future)) none), which is at least surprising if not actually wrong.
- Currently this would seem to be valid:
- Ints:
- Depending on how I squint it looks like
(value u64 -1)might be valid viacore:i64(wrapping tou64::MAX).
- Depending on how I squint it looks like
Separately: the bottom of the value definitions section describes value imports/exports but the Nope, I was looking in the wrong place.import/export defs are missing matching rules.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the value definitions section in design/mvp/Explainer.md and compare its val rules with the WAVE mapping and the referenced value definitions. Trace the char, float, handle, and integer cases, then determine the intended grammar and validation behavior for each ambiguity. Done means the specification has an agreed, unambiguous treatment of the reported cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- wasm
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100