Skip to content

馃獧 Value text encoding ambiguities / quirks#718

Description

@lann

In looking at WAVE mapping to value defs (ref #639 (comment)) 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. 馃檨
  • floats
    • f32 is encoded as core:f64 which leaves rounding and overflow ambiguous, e.g. core:f64 accepts 1e99 which will overflow an f32.
    • f64canon rejects nan:0x but 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.
  • Ints:
    • Depending on how I squint it looks like (value u64 -1) might be valid via core:i64 (wrapping to u64::MAX).

Separately: the bottom of the value definitions section describes value imports/exports but the import/export defs are missing matching rules. Nope, I was looking in the wrong place.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions