Skip to content

Explore mechanisms for defining external binary representations #4

Open
@jverkoey

Description

@jverkoey

Swift Codable is able to generate encoding and decoding implementations for free because of the availability of key/value containers. Binary Codable does not support key/value containers, so it is not presently possible to map properties to external representations without making some potentially scary assumptions about order.

A completely generalized solution to this problem is not desired due to the need for conditional encoding/decoding paths in complex cases. Solving conditional coding is considered a non-goal for this task; in such cases custom implementations of encoding/decoding are encouraged instead.

A successful solution to this task will meet the following requirements:

  • It is possible to map properties to regions of memory bi-directionally (encoding + decoding).
  • It is possible to map BinaryCodable entities to regions of memory bi-directionally (encoding + decoding).
  • Such a definition only needs to be made once for a given object, similar to the CodingKeys pattern in Swift Codable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions