why don't programming engines support pluggable structure layouts so eg CapnProto style memcpy could work directly, rather than having the overhead of eg converting from a protobuf to a javascript native object?
so whatever marshals out also includes a schema, whatever unmarshals uses the schema when working on the structure.
it would mean each native type could have any/many underlying representations. not a security or perf hole i'm sure. /s
a remaining unavoidable problem is cpu endianness tho.