Generating code to do lazy decoding of messages from a byte array.

Ideas

ASN.1

ASN.1 compilers for ASN.1 to C structures.

Structs with member accessors which parse and cache their data on demand.